2022-10-24 21:51:15 +00:00
|
|
|
name: test
|
|
|
|
|
2022-12-04 00:42:59 +00:00
|
|
|
on:
|
2023-07-21 16:20:24 +00:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
working-directory:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
description: "From which folder this pipeline executes"
|
2023-11-20 21:09:30 +00:00
|
|
|
langchain-location:
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
description: "Relative path to the langchain library folder"
|
2022-12-04 00:42:59 +00:00
|
|
|
|
|
|
|
env:
|
2024-01-17 16:51:20 +00:00
|
|
|
POETRY_VERSION: "1.7.1"
|
2022-10-24 21:51:15 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-07-21 16:20:24 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ${{ inputs.working-directory }}
|
2022-10-24 21:51:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-12-04 00:42:59 +00:00
|
|
|
python-version:
|
2022-12-13 13:48:53 +00:00
|
|
|
- "3.8"
|
|
|
|
- "3.9"
|
|
|
|
- "3.10"
|
|
|
|
- "3.11"
|
2024-02-01 19:09:37 +00:00
|
|
|
name: python${{ matrix.python-version }}
|
2022-10-24 21:51:15 +00:00
|
|
|
steps:
|
2023-10-23 14:01:33 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-22 19:59:22 +00:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
2023-05-10 13:35:07 +00:00
|
|
|
uses: "./.github/actions/poetry_setup"
|
2022-12-13 13:48:53 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-08-21 14:35:56 +00:00
|
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
2023-08-22 19:59:22 +00:00
|
|
|
working-directory: ${{ inputs.working-directory }}
|
2023-08-22 15:36:52 +00:00
|
|
|
cache-key: core
|
2023-08-22 19:59:22 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
shell: bash
|
2023-11-28 21:26:15 +00:00
|
|
|
run: poetry install --with test
|
2023-08-22 19:59:22 +00:00
|
|
|
|
2023-11-20 21:09:30 +00:00
|
|
|
- name: Install langchain editable
|
|
|
|
working-directory: ${{ inputs.working-directory }}
|
|
|
|
if: ${{ inputs.langchain-location }}
|
|
|
|
env:
|
|
|
|
LANGCHAIN_LOCATION: ${{ inputs.langchain-location }}
|
|
|
|
run: |
|
|
|
|
poetry run pip install -e "$LANGCHAIN_LOCATION"
|
|
|
|
|
2023-08-22 15:36:52 +00:00
|
|
|
- name: Run core tests
|
2023-05-11 01:57:39 +00:00
|
|
|
shell: bash
|
2023-11-20 21:09:30 +00:00
|
|
|
run: |
|
|
|
|
make test
|
2023-09-06 15:15:16 +00:00
|
|
|
|
|
|
|
- name: Ensure the tests did not create any additional files
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
STATUS="$(git status)"
|
|
|
|
echo "$STATUS"
|
|
|
|
|
|
|
|
# grep will exit non-zero if the target message isn't found,
|
|
|
|
# and `set -e` above will cause the step to fail.
|
|
|
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|