Skip to content

Commit 5895731

Browse files
dbantymicha91
authored andcommitted
ci: Test minimum dependencies in CI (openapi-generators#1182)
This way, when we upgrade the upper limit of a dependency (and the version we test for most of the time), we don't accidentally break our listed minimum version. --------- Co-authored-by: Dylan Anthony <[email protected]>
1 parent d403185 commit 5895731

File tree

4 files changed

+1028
-90
lines changed

4 files changed

+1028
-90
lines changed

.github/workflows/checks.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,11 @@ jobs:
5151
- name: Run pytest without coverage
5252
if: matrix.os != 'ubuntu-latest'
5353
run: pdm test
54-
env:
55-
TASKIPY: true
5654

5755
- name: Run pytest with coverage
5856
if: matrix.os == 'ubuntu-latest'
5957
run: pdm test_with_coverage
60-
env:
61-
TASKIPY: true
62-
58+
6359
- run: mv .coverage .coverage.${{ matrix.python }}
6460
if: matrix.os == 'ubuntu-latest'
6561

@@ -72,6 +68,45 @@ jobs:
7268
if-no-files-found: error
7369
include-hidden-files: true
7470

71+
test_min_deps:
72+
strategy:
73+
matrix:
74+
os: [ ubuntu-latest, macos-latest, windows-latest ]
75+
runs-on: ${{ matrix.os }}
76+
steps:
77+
- uses: actions/[email protected]
78+
- name: Set up Python
79+
uses: actions/[email protected]
80+
with:
81+
python-version: "3.9"
82+
83+
- name: Get Python Version
84+
id: get_python_version
85+
run: echo "python_version=$(python --version)" >> $GITHUB_OUTPUT
86+
shell: bash
87+
88+
- name: Cache dependencies
89+
uses: actions/cache@v4
90+
with:
91+
path: .venv
92+
key: ${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-min-dependencies-${{ hashFiles('**/pdm.lock') }}
93+
restore-keys: |
94+
${{ runner.os }}-${{ steps.get_python_version.outputs.python_version }}-min-dependencies
95+
- name: Install PDM
96+
run: pip install pdm
97+
98+
- name: Install minimum dependencies
99+
run: pdm install -L pdm.minimal.lock
100+
101+
- name: Run mypy
102+
run: pdm mypy --show-error-codes
103+
104+
- name: Lint
105+
run: pdm run ruff check .
106+
107+
- name: Run unit tests only # snapshots are expected to fail
108+
run: pdm unit_test
109+
75110
coverage:
76111
name: Combine & check coverage
77112
needs: test

pdm.lock

Lines changed: 31 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)