Skip to content

Commit 9f97793

Browse files
[CI] add compatibility check to unit test
1 parent c500104 commit 9f97793

2 files changed

Lines changed: 44 additions & 20 deletions

File tree

.github/workflows/compatibility.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,23 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
prepare:
13+
prepare-compat:
1414
runs-on: ubuntu-latest
1515
outputs:
1616
versions: ${{ steps.parser.outputs.versions || '[]' }}
1717
steps:
18-
- uses: actions/checkout@v6
19-
with:
20-
fetch-depth: 2
21-
22-
- name: Check license line changed
23-
id: check
24-
run: |
25-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
26-
echo "changed=true" >> "$GITHUB_OUTPUT"
27-
elif git diff HEAD~1 HEAD -- pyproject.toml | grep -q '^[+-].*license = "Apache-2.0"'; then
28-
echo "changed=true" >> "$GITHUB_OUTPUT"
29-
else
30-
echo "changed=false" >> "$GITHUB_OUTPUT"
31-
fi
32-
3318
- uses: actions/setup-python@v6
34-
if: steps.check.outputs.changed == 'true'
3519
with:
3620
python-version: "3.14"
3721

3822
- name: Generate version matrix
39-
if: steps.check.outputs.changed == 'true'
4023
id: parser
4124
run: |
4225
versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83")
4326
echo "versions=$versions" >> "$GITHUB_OUTPUT"
4427
45-
check:
46-
needs: prepare
28+
check-compat:
29+
needs: prepare-compat
4730
if: needs.prepare.outputs.versions != '[]'
4831
runs-on: ubuntu-latest
4932
strategy:

.github/workflows/unit_tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,44 @@ jobs:
159159
run: |
160160
mkdir -p artifacts
161161
pytest --durations=0 tests/${{ matrix.test_script }}.py --junitxml=artifacts/${{ runner.os }}-${{ matrix.test_script }}.xml
162+
163+
prepare-compat:
164+
runs-on: ubuntu-latest
165+
outputs:
166+
versions: ${{ steps.parser.outputs.versions || '[]' }}
167+
steps:
168+
- uses: actions/setup-python@v6
169+
with:
170+
python-version: "3.14"
171+
172+
- name: Generate version matrix
173+
id: parser
174+
run: |
175+
versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83")
176+
echo "versions=$versions" >> "$GITHUB_OUTPUT"
177+
178+
check-compat:
179+
needs: prepare-compat
180+
if: needs.prepare.outputs.versions != '[]'
181+
runs-on: ubuntu-latest
182+
strategy:
183+
fail-fast: false
184+
matrix:
185+
version: ${{ fromJSON(needs.prepare.outputs.versions) }}
186+
187+
steps:
188+
- uses: actions/checkout@v6
189+
- uses: actions/setup-python@v6
190+
with:
191+
python-version: "3.14"
192+
cache: pip
193+
194+
- name: Install package with selected setuptools
195+
run: |
196+
python -m pip install --upgrade pip
197+
python -m pip install . "setuptools==${{ matrix.version }}"
198+
199+
- name: Show versions
200+
run: |
201+
python --version
202+
python -m pip show setuptools

0 commit comments

Comments
 (0)