Skip to content

Commit 8646305

Browse files
committed
Update test workflow
1 parent 06fd0d7 commit 8646305

File tree

2 files changed

+44
-62
lines changed

2 files changed

+44
-62
lines changed

.github/workflows/codecov.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,64 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-python@v2
1515
with:
16-
python-version: 3.9
16+
python-version: "3.10"
1717
- uses: actions/cache@v2
18+
id: cache-venv
1819
with:
19-
path: |
20-
~/.cache/pip
21-
~/.cache/pre-commit
22-
key: ${{ runner.os }}-pip-2
23-
restore-keys: |
24-
${{ runner.os }}-pip-
25-
${{ runner.os }}-
26-
- run: python -m pip install pre-commit
27-
- run: pre-commit run --all-files
28-
get-python-versions:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v2
32-
- id: set-matrix
33-
run: echo "::set-output name=matrix::$(python .github/scripts/get_python_versions.py)"
34-
outputs:
35-
matrix: ${{ steps.set-matrix.outputs.matrix }}
20+
path: .venv
21+
key: venv-0
22+
- run: |
23+
python -m venv .venv --upgrade-deps
24+
source .venv/bin/activate
25+
pip install pre-commit
26+
if: steps.cache-venv.outputs.cache-hit != 'true'
27+
- uses: actions/cache@v2
28+
id: pre-commit-cache
29+
with:
30+
path: ~/.cache/pre-commit
31+
key: key-0
32+
- run: |
33+
source .venv/bin/activate
34+
pre-commit run --all-files
35+
3636
test:
37-
needs: [ linting, get-python-versions ]
3837
runs-on: ubuntu-latest
3938
strategy:
4039
fail-fast: false
4140
matrix:
42-
python-version: ${{ fromJson(needs.get-python-versions.outputs.matrix) }}
41+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
4342
steps:
4443
- uses: actions/checkout@v2
4544
- uses: actions/setup-python@v2
4645
with:
47-
python-version: ${{ matrix.python-version }}
48-
- uses: snok/install-poetry@v1.1.6
46+
python-version: "${{ matrix.python-version }}"
47+
- uses: actions/cache@v2
48+
id: poetry-cache
49+
with:
50+
path: ~/.local
51+
key: key-0
52+
- uses: snok/install-poetry@v1
4953
with:
50-
version: 1.2.0a1
51-
virtualenvs-in-project: true
54+
virtualenvs-create: false
55+
version: 1.2.0a2
5256
- uses: actions/cache@v2
5357
id: cache-venv
5458
with:
5559
path: .venv
56-
key: ${{ hashFiles('**/poetry.lock') }}-3
57-
- run: poetry install --no-interaction --no-root
60+
key: ${{ hashFiles('**/poetry.lock') }}-0
61+
- run: |
62+
python -m venv .venv
63+
source .venv/bin/activate
64+
pip install -U pip
65+
poetry install --no-interaction --no-root
5866
if: steps.cache-venv.outputs.cache-hit != 'true'
59-
- run: poetry install --no-interaction
60-
- run: poetry run pytest -m "not unsupported"
67+
- name: Run tests
68+
run: |
69+
source .venv/bin/activate
70+
pytest -m "not unsupported" --cov-report=xml
71+
coverage report
72+
- uses: codecov/codecov-action@v2
73+
with:
74+
file: ./coverage.xml
75+
fail_ci_if_error: true
76+
if: matrix.python-version == '3.10'

0 commit comments

Comments
 (0)