|
11 | 11 | PRE_COMMIT_COLOR: always |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - build: |
| 14 | + # We only need to lint once, not for _each_ python version |
| 15 | + lint: |
15 | 16 | runs-on: ${{ matrix.os }} |
16 | 17 | strategy: |
17 | 18 | fail-fast: false |
18 | 19 | matrix: |
19 | | - python-version: ['3.7', '3.8', '3.9', '3.10'] |
| 20 | + python-version: ['3.11'] |
20 | 21 | os: [ubuntu-latest] |
21 | 22 | env: |
22 | 23 | PYTHON: ${{ matrix.python-version }} |
23 | 24 | steps: |
24 | 25 | - uses: actions/checkout@v2 |
25 | 26 | - name: Set up Python ${{ matrix.python-version }} |
26 | | - uses: actions/setup-python@v2 |
| 27 | + uses: actions/setup-python@v4 |
27 | 28 | with: |
28 | 29 | python-version: ${{ matrix.python-version }} |
29 | | - - name: Cache deps |
30 | | - uses: actions/cache@v2 |
| 30 | + - name: Cache python deps |
| 31 | + uses: actions/cache@v3 |
31 | 32 | with: |
32 | 33 | path: | |
33 | | - ~/.cache/pypoetry/ |
34 | 34 | ~/.cache/pip/ |
| 35 | + ~/.cache/pypoetry/ |
35 | 36 | key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} |
36 | 37 | restore-keys: python${{ matrix.python-version }}- |
37 | | - - name: Cache pre-commit deps |
38 | | - uses: actions/cache@v2 |
| 38 | + - name: Cache pre-commitdeps |
| 39 | + uses: actions/cache@v3 |
39 | 40 | with: |
40 | 41 | path: | |
41 | 42 | ~/.cache/pre-commit/ |
42 | | - key: precommit-${{ hashFiles('.pre-commit-config.yaml') }} |
43 | | - restore-keys: precommit- |
| 43 | + key: precommit-py${{ matrix.python-version }}-precommit-${{ hashFiles('poetry.lock', '.pre-commit-config.yaml') }} |
| 44 | + restore-keys: precommit-py${{ matrix.python-version }}- |
44 | 45 | - name: Install dependencies |
45 | 46 | run: | |
46 | 47 | python -m pip install --upgrade pip |
47 | | - python -m pip install --upgrade poetry pre-commit |
48 | | - poetry install |
| 48 | + python -m pip install --upgrade pre-commit poetry |
| 49 | + poetry install --no-root |
49 | 50 | - name: Lint |
50 | 51 | run: | |
51 | 52 | pre-commit run --all-files -v --show-diff-on-failure |
52 | | - poetry run pytest --dead-fixtures --dup-fixtures --color=yes |
53 | 53 | pre-commit gc |
| 54 | + build: |
| 55 | + runs-on: ${{ matrix.os }} |
| 56 | + strategy: |
| 57 | + fail-fast: false |
| 58 | + matrix: |
| 59 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] |
| 60 | + os: [ubuntu-latest] |
| 61 | + env: |
| 62 | + PYTHON: ${{ matrix.python-version }} |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - name: Set up Python ${{ matrix.python-version }} |
| 66 | + uses: actions/setup-python@v4 |
| 67 | + with: |
| 68 | + python-version: ${{ matrix.python-version }} |
| 69 | + - name: Cache deps |
| 70 | + uses: actions/cache@v3 |
| 71 | + with: |
| 72 | + path: | |
| 73 | + ~/.cache/pypoetry/ |
| 74 | + ~/.cache/pip/ |
| 75 | + key: python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} |
| 76 | + restore-keys: python${{ matrix.python-version }}- |
| 77 | + - name: Install dependencies |
| 78 | + run: | |
| 79 | + python -m pip install --upgrade pip |
| 80 | + python -m pip install --upgrade poetry |
| 81 | + poetry install |
54 | 82 | - name: Test with pytest |
55 | 83 | run: | |
56 | 84 | make test args="--color=yes" |
| 85 | + poetry run pytest --dead-fixtures --dup-fixtures --color=yes |
57 | 86 | - name: Upload coverage to Codecov |
58 | 87 | |
59 | 88 | with: |
|
0 commit comments