mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
83986ea98a
With this PR: - All lint and test jobs use the exact same Python + Poetry installation approach, instead of lints doing it one way and tests doing it another way. - The Poetry installation itself is cached, which saves ~15s per run. - We no longer pass shell commands as workflow arguments to a workflow that just runs them in a shell. This makes our actions more resilient to shell code injection. If y'all like this approach, I can modify the scheduled tests workflow and the release workflow to use this too.
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
name: test
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
working-directory:
|
|
required: true
|
|
type: string
|
|
description: "From which folder this pipeline executes"
|
|
|
|
env:
|
|
POETRY_VERSION: "1.5.1"
|
|
|
|
jobs:
|
|
build:
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ inputs.working-directory }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version:
|
|
- "3.8"
|
|
- "3.9"
|
|
- "3.10"
|
|
- "3.11"
|
|
name: Python ${{ matrix.python-version }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
|
uses: "./.github/actions/poetry_setup"
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
|
working-directory: ${{ inputs.working-directory }}
|
|
cache-key: core
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: poetry install
|
|
|
|
- name: Run core tests
|
|
shell: bash
|
|
run: make test
|