@@ -14,21 +14,17 @@ jobs:
14
14
uses : actions/setup-python@v2
15
15
with :
16
16
python-version : 3.9
17
- - name : Update pip
18
- run : |
19
- python -m pip install --upgrade pip
20
- - name : Install and run pre-commit
21
- uses :
pre-commit/[email protected]
17
+ -
uses :
pre-commit/[email protected]
22
18
with :
23
- extra_args : --all-files
19
+ extra_args : --all-files --show-diff-on-failure
24
20
pytest :
25
21
needs :
26
22
- lint
27
23
strategy :
28
24
fail-fast : false
29
25
matrix :
30
26
python-version : [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9" ]
31
- poetry-version : [ "latest " ]
27
+ poetry-version : [ "1.5.1 " ]
32
28
os : [ ubuntu-20.04, macos-latest, windows-latest ]
33
29
runs-on : ${{ matrix.os }}
34
30
name : Python ${{ matrix.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
44
40
with :
45
41
python-version : ${{ matrix.python-version }}
46
42
cache : ' pip'
47
- - name : Update pip
43
+ - name : Select the cache folder
44
+ id : cache-folder
48
45
run : |
49
- python -m pip install --upgrade pip
46
+ if [ ${{ matrix.os }} == 'ubuntu-20.04' ]; then
47
+ CACHE_FOLDER="/home/runner/.cache/pypoetry"
48
+ elif [ ${{ matrix.os }} == 'macos-latest' ]; then
49
+ CACHE_FOLDER="/Users/runner/Library/Caches/pypoetry"
50
+ elif [ ${{ matrix.os }} == 'windows-latest' ]; then
51
+ CACHE_FOLDER="C:\Users\runneradmin\AppData\Local\pypoetry\Cache"
52
+ fi
53
+ echo "Cache folder is $CACHE_FOLDER"
54
+ echo "folder=$CACHE_FOLDER" >> "$GITHUB_OUTPUT"
55
+ - name : Cache Poetry cache
56
+ uses : actions/cache@v3
57
+ with :
58
+ path : ${{ steps.cache-folder.outputs.folder }}
59
+ key : poetry-cache-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}
50
60
- name : Run Poetry action
51
61
uses : abatilo/actions-poetry@v2
52
62
with :
58
68
- name : Run tests
59
69
run : poetry run pytest
60
70
- name : Upload coverage to Codecov
61
- uses : codecov/codecov-action@v1
71
+ uses : codecov/codecov-action@v3
62
72
with :
63
73
token : ${{ secrets.CODECOV_TOKEN }}
64
74
flags : unittests
0 commit comments