11name : tests
22
33on :
4- pull_request :
5- branches : ' **'
4+ push :
5+ branches : [ '**']
66
77jobs :
8- lint :
9- runs-on : ubuntu-20.04
10- steps :
11- - name : checkout
12- uses : actions/checkout@v2
13- - name : Install Python
14- uses : actions/setup-python@v2
15- with :
16- python-version : 3.9
17- - uses : pre-commit/action@v3.0.0
18- with :
19- extra_args : --all-files --show-diff-on-failure
208 pytest :
21- needs :
22- - lint
239 strategy :
2410 fail-fast : false
2511 matrix :
@@ -40,39 +26,15 @@ jobs:
4026 with :
4127 python-version : ${{ matrix.python-version }}
4228 cache : ' pip'
43- - name : Select the cache folder
44- id : cache-folder
45- run : |
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 }}
60- - name : Run Poetry action
61- uses : abatilo/actions-poetry@v2
62- with :
63- poetry-version : ${{ matrix.poetry-version }}
64- - name : View poetry --version
65- run : poetry --version
6629 - name : Install dependencies
67- run : poetry install
30+ run : pip install -r requirements.txt
31+ - name : Install test dependencies
32+ run : pip install -r test-requirements.txt
33+ - name : Install tox
34+ run : pip install tox
35+ - name : Setup API Key
36+ env :
37+ ORS_API_KEY : ${{ secrets.ORS_API_KEY }}
38+ run : printf "[ORS]\napiKey = $ORS_API_KEY\n" > tests-config.ini
6839 - name : Run tests
69- run : poetry run pytest
70- - name : Upload coverage to Codecov
71- uses : codecov/codecov-action@v3
72- with :
73- token : ${{ secrets.CODECOV_TOKEN }}
74- flags : unittests
75- env_vars : OS,PYTHON
76- name : codecov-umbrella
77- fail_ci_if_error : true
78- verbose : true
40+ run : python -m tox
0 commit comments