22
33name : Check Pull Request
44
5- # Controls when the action will run. Triggers the workflow on pull requests.
6- on : [push, pull_request]
5+ # Controls when the action will run.
6+ on :
7+ push :
8+ branches : [ main ]
9+ pull_request :
10+ branches : [ main ]
711
812# A workflow run is made up of one or more jobs that can run sequentially or in parallel
913jobs :
1014 # This workflow contains a single job called "build"
1115 build :
12- runs-on : ubuntu-latest
13- # The type of runner that the job will run on
16+ strategy :
17+ fail-fast : false
18+ matrix :
19+ os : [ ubuntu-latest, windows-latest ]
20+ python-version : [ "3.9", "3.10" ]
21+ exclude :
22+ - os : windows-latest
23+ python-version : " 3.9"
24+
25+ runs-on : ${{ matrix.os }}
1426
1527 steps :
1628
1729 # ----------------------------------------------
18- # check-out repo and set-up python
30+ # check-out repo and set-up python
1931 # ----------------------------------------------
2032 - name : Check out repository
21- uses : actions/checkout@v2
33+ uses : actions/checkout@v3
2234
23- - name : Set up Python 3.9
24- uses : actions/setup-python@v2
35+ - name : Set up Python ${{ matrix.python-version }}
36+ uses : actions/setup-python@v3
2537 with :
26- python-version : 3.9
27-
38+ python-version : ${{ matrix.python-version }}
39+
2840 # ----------------------------------------------
29- # install & configure poetry
41+ # install & configure poetry
3042 # ----------------------------------------------
3143 - name : Install Poetry
32- uses : snok/install-poetry@v1.1.6
44+ uses : snok/install-poetry@v1.3.1
3345 with :
3446 virtualenvs-create : true
35- virtualenvs-in-project : true
47+ virtualenvs-in-project : true
3648
3749# # Install dependencies
3850# - name: pip Install Dependencies
4153# pip install -r requirements.txt
4254
4355 # ----------------------------------------------
44- # load cached venv if cache exists
56+ # load cached venv if cache exists
4557 # ----------------------------------------------
4658 - name : Load cached venv
4759 id : cached-poetry-dependencies
@@ -51,26 +63,26 @@ jobs:
5163 key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
5264
5365 # ----------------------------------------------
54- # install dependencies if cache does not exist
66+ # install dependencies if cache does not exist
5567 # ----------------------------------------------
5668 - name : Install dependencies
5769 if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
5870 run : poetry install --no-interaction --no-root
59-
71+
72+ # ----------------------------------------------
73+ # install your root project, if required
6074 # ----------------------------------------------
61- # install your root project, if required
62- # ----------------------------------------------
6375 - name : Install library
6476 run : poetry install --no-interaction
65-
77+
6678# - name: Run image
67796880# # with:
6981# # poetry-version: ${{ matrix.poetry-version }}
7082# - name: View poetry --help
7183# run: poetry --help
7284
73- # Make test
74- - name : Make test
85+ - name : Run test suite
7586 run : |
76- make test
87+ poetry run pip install -U pytest
88+ poetry run pytest tests/
0 commit comments