2
2
3
3
name : Check Pull Request
4
4
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 ]
7
11
8
12
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
9
13
jobs :
10
14
# This workflow contains a single job called "build"
11
15
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 }}
14
26
15
27
steps :
16
28
17
29
# ----------------------------------------------
18
- # check-out repo and set-up python
30
+ # check-out repo and set-up python
19
31
# ----------------------------------------------
20
32
- name : Check out repository
21
- uses : actions/checkout@v2
33
+ uses : actions/checkout@v3
22
34
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
25
37
with :
26
- python-version : 3.9
27
-
38
+ python-version : ${{ matrix.python-version }}
39
+
28
40
# ----------------------------------------------
29
- # install & configure poetry
41
+ # install & configure poetry
30
42
# ----------------------------------------------
31
43
- name : Install Poetry
32
- uses : snok/install-poetry@v1.1.6
44
+ uses : snok/install-poetry@v1.3.1
33
45
with :
34
46
virtualenvs-create : true
35
- virtualenvs-in-project : true
47
+ virtualenvs-in-project : true
36
48
37
49
# # Install dependencies
38
50
# - name: pip Install Dependencies
41
53
# pip install -r requirements.txt
42
54
43
55
# ----------------------------------------------
44
- # load cached venv if cache exists
56
+ # load cached venv if cache exists
45
57
# ----------------------------------------------
46
58
- name : Load cached venv
47
59
id : cached-poetry-dependencies
@@ -51,26 +63,26 @@ jobs:
51
63
key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
52
64
53
65
# ----------------------------------------------
54
- # install dependencies if cache does not exist
66
+ # install dependencies if cache does not exist
55
67
# ----------------------------------------------
56
68
- name : Install dependencies
57
69
if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
58
70
run : poetry install --no-interaction --no-root
59
-
71
+
72
+ # ----------------------------------------------
73
+ # install your root project, if required
60
74
# ----------------------------------------------
61
- # install your root project, if required
62
- # ----------------------------------------------
63
75
- name : Install library
64
76
run : poetry install --no-interaction
65
-
77
+
66
78
# - name: Run image
67
79
68
80
# # with:
69
81
# # poetry-version: ${{ matrix.poetry-version }}
70
82
# - name: View poetry --help
71
83
# run: poetry --help
72
84
73
- # Make test
74
- - name : Make test
85
+ - name : Run test suite
75
86
run : |
76
- make test
87
+ poetry run pip install -U pytest
88
+ poetry run pytest tests/
0 commit comments