Skip to content

Commit 9eae89e

Browse files
[CI] add compatibility check to unit test (#46)
* [CI] add compatibility check to unit test * [CI] fix path * [CI] rename to setuptools * [CI] fix needs reference * [CI] restore checkout step * [CI] fix requests & packaging
1 parent c500104 commit 9eae89e

2 files changed

Lines changed: 50 additions & 22 deletions

File tree

.github/workflows/compatibility.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,31 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
prepare:
13+
prepare-setuptools:
1414
runs-on: ubuntu-latest
1515
outputs:
1616
versions: ${{ steps.parser.outputs.versions || '[]' }}
1717
steps:
1818
- 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-
3319
- uses: actions/setup-python@v6
34-
if: steps.check.outputs.changed == 'true'
3520
with:
3621
python-version: "3.14"
3722

3823
- name: Generate version matrix
39-
if: steps.check.outputs.changed == 'true'
4024
id: parser
4125
run: |
42-
versions=$(python ci_loop_versions.py setuptools ">=77.0.1,<83")
26+
python -m pip install --upgrade requests packaging
27+
versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83")
4328
echo "versions=$versions" >> "$GITHUB_OUTPUT"
4429
45-
check:
46-
needs: prepare
47-
if: needs.prepare.outputs.versions != '[]'
30+
check-setuptools:
31+
needs: prepare-setuptools
32+
if: needs.prepare-setuptools.outputs.versions != '[]'
4833
runs-on: ubuntu-latest
4934
strategy:
5035
fail-fast: false
5136
matrix:
52-
version: ${{ fromJSON(needs.prepare.outputs.versions) }}
37+
version: ${{ fromJSON(needs.prepare-setuptools.outputs.versions) }}
5338

5439
steps:
5540
- uses: actions/checkout@v6

.github/workflows/unit_tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,46 @@ 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-setuptools:
164+
runs-on: ubuntu-latest
165+
outputs:
166+
versions: ${{ steps.parser.outputs.versions || '[]' }}
167+
steps:
168+
- uses: actions/checkout@v6
169+
- uses: actions/setup-python@v6
170+
with:
171+
python-version: "3.14"
172+
173+
- name: Generate version matrix
174+
id: parser
175+
run: |
176+
python -m pip install --upgrade requests packaging
177+
versions=$(python .github/scripts/ci_loop_versions.py setuptools ">=77.0.1,<83")
178+
echo "versions=$versions" >> "$GITHUB_OUTPUT"
179+
180+
check-setuptools:
181+
needs: prepare-setuptools
182+
if: needs.prepare-setuptools.outputs.versions != '[]'
183+
runs-on: ubuntu-latest
184+
strategy:
185+
fail-fast: false
186+
matrix:
187+
version: ${{ fromJSON(needs.prepare-setuptools.outputs.versions) }}
188+
189+
steps:
190+
- uses: actions/checkout@v6
191+
- uses: actions/setup-python@v6
192+
with:
193+
python-version: "3.14"
194+
cache: pip
195+
196+
- name: Install package with selected setuptools
197+
run: |
198+
python -m pip install --upgrade pip
199+
python -m pip install . "setuptools==${{ matrix.version }}"
200+
201+
- name: Show versions
202+
run: |
203+
python --version
204+
python -m pip show setuptools

0 commit comments

Comments
 (0)