Skip to content

Commit 4f311c8

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
Update test workflow to include Python 3.9.1 job and fix cache key for
better dependency isolation
1 parent 365afec commit 4f311c8

1 file changed

Lines changed: 42 additions & 8 deletions

File tree

.github/workflows/tests_and_coverage.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,36 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macos-latest, ubuntu-latest, windows-latest]
11-
python-version: ["3.8", "3.9", "3.9.1", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-alpha.1"]
11+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15.0-alpha.1"]
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
1516
- name: Set up Python ${{ matrix.python-version }}
1617
uses: actions/setup-python@v5
1718
with:
1819
python-version: ${{ matrix.python-version }}
1920

20-
- name: Install the library
21-
shell: bash
22-
run: pip install .
23-
2421
- name: Cache pip dependencies
2522
uses: actions/cache@v4
2623
with:
2724
path: ~/.cache/pip
28-
key: ${{ runner.os }}-pip-${{ github.workflow }}-${{ hashFiles('requirements_dev.txt') }}
29-
restore-keys: |
30-
${{ runner.os }}-pip-${{ github.workflow }}-
25+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ github.workflow }}-${{ hashFiles('requirements_dev.txt') }}
3126

3227
- name: Install dependencies
3328
shell: bash
3429
run: pip install -r requirements_dev.txt
3530

31+
- name: Install the library
32+
shell: bash
33+
run: pip install .
34+
3635
- name: Print all libs
3736
shell: bash
3837
run: pip list
3938

4039
- name: Run tests and show coverage on the command line
40+
shell: bash
4141
run: |
4242
coverage run --source=transfunctions --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=94
4343
coverage xml
@@ -53,4 +53,38 @@ jobs:
5353
continue-on-error: true
5454

5555
- name: Run tests and show the branch coverage on the command line
56+
shell: bash
57+
run: coverage run --branch --source=transfunctions --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=94
58+
59+
# 2. A separate job specifically for bug testing in Python 3.9.1 (Linux only)
60+
build-3-9-1:
61+
runs-on: ubuntu-latest
62+
container: python:3.9.1
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Cache pip dependencies
67+
uses: actions/cache@v4
68+
with:
69+
path: ~/.cache/pip
70+
key: ubuntu-pip-3.9.1-${{ github.workflow }}-${{ hashFiles('requirements_dev.txt') }}
71+
72+
- name: Install dependencies
73+
shell: bash
74+
run: pip install -r requirements_dev.txt
75+
76+
- name: Install the library
77+
shell: bash
78+
run: pip install .
79+
80+
- name: Print all libs
81+
shell: bash
82+
run: pip list
83+
84+
- name: Run tests and show coverage on the command line
85+
shell: bash
86+
run: coverage run --source=transfunctions --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=94
87+
88+
- name: Run tests and show the branch coverage on the command line
89+
shell: bash
5690
run: coverage run --branch --source=transfunctions --omit="*tests*" -m pytest --cache-clear --assert=plain && coverage report -m --fail-under=94

0 commit comments

Comments
 (0)