Repository navigation
101 lines (89 loc) · 2.82 KB
/
Copy path_test.yml
File metadata and controls
101 lines (89 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Reusable Tests
on:
workflow_call:
inputs:
os:
description: "Operating system name"
required: true
default: Ubuntu
type: string
image:
description: "Runner image"
required: true
default: ubuntu-latest
type: string
python-version:
description: "Python version to test against"
required: true
default: "3.10"
type: string
upgrade-deps:
description: "Whether to install all extras"
required: false
default: false
type: boolean
with-coverage:
description: "Whether to run tests with coverage reporting"
required: false
default: false
type: boolean
secrets:
CODECOV_TOKEN:
required: false
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
tests:
name: ${{ inputs.os }} / Python ${{ inputs.python-version }}
runs-on: ${{ inputs.image }}
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
uses: ./.github/actions/setup-uv
with:
cache-suffix: ${{ inputs.python-version }}
- name: Check lock file
run: uv lock --check
- name: Install dependencies
run: |
if [ "${{ inputs.upgrade-deps}}" = "true" ]; then
uv lock --upgrade
uv sync --locked --all-extras --group dev
else
uv sync --locked --group dev
fi
- name: Run pytest with coverage
if: inputs.with-coverage
env:
# Enable the langchain-community provider drift canary only when
# testing upgraded dependencies (the scheduled latest-deps job).
LANGCHAIN_PROVIDER_DRIFT_CHECK: ${{ inputs.upgrade-deps && '1' || '' }}
run: make test-coverage ARGS="--cov-fail-under=85 --cov-report=term"
- name: Run pytest without coverage
if: inputs.with-coverage == false
env:
# Enable the langchain-community provider drift canary only when
# testing upgraded dependencies (the scheduled latest-deps job).
LANGCHAIN_PROVIDER_DRIFT_CHECK: ${{ inputs.upgrade-deps && '1' || '' }}
run: make test
- name: Upload coverage to Codecov
if: inputs.with-coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
directory: ./coverage/reports/
env_vars: PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: python
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true