1
+ # For details of what checks are run for PRs please refer below
2
+ # docs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3
+ name : Python CI
4
+
5
+ on :
6
+ push :
7
+ branches : ["master"]
8
+ pull_request :
9
+ workflow_dispatch :
10
+ schedule :
11
+ # schedule weekly tests, since dependencies are not intended to be pinned
12
+ # this means: at 23:42 on Fridays
13
+ - cron : ' 42 23 * * 5'
14
+
15
+ env :
16
+ REPORTS_DIR : CI_reports
17
+
18
+ jobs :
19
+ build-and-test :
20
+ name : Build & Test (Python ${{ matrix.python-version }}
21
+ runs-on : ubuntu-latest
22
+ strategy :
23
+ fail-fast : false
24
+ matrix :
25
+ python-version :
26
+ - " 3.9" # highest and lowest supported
27
+ timeout-minutes : 30
28
+ steps :
29
+ - name : Checkout
30
+ # see https://github.com/actions/checkout
31
+ uses : actions/checkout@v2
32
+ - name : Create reports directory
33
+ run : mkdir ${{ env.REPORTS_DIR }}
34
+ - name : Setup Python Environment
35
+ # see https://github.com/actions/setup-python
36
+ uses : actions/setup-python@v2
37
+ with :
38
+ python-version : {{ matrix.python-version }}
39
+ architecture : ' x64'
40
+ - name : Install poetry
41
+ # see https://github.com/marketplace/actions/setup-poetry
42
+ uses : Gr1N/setup-poetry@v7
43
+ with :
44
+ poetry-version : 1.1.8
45
+ - name : Install dependencies
46
+ run : poetry install
47
+ - name : Ensure build successful
48
+ run : poetry build
49
+ - name : Run tox
50
+ run : tox
51
+ - name : Generate coverage reports
52
+ run : >
53
+ coverage report && coverage xml -o ${{ env.REPORTS_DIR }}/coverage.xml &&
54
+ coverage html -d ${{ env.REPORTS_DIR }}
55
+ - name : Artifact reports
56
+ if : ${{ ! cancelled() }}
57
+ # see https://github.com/actions/upload-artifact
58
+ uses : actions/upload-artifact@v2
59
+ with :
60
+ name : ${{ env.REPORTS_ARTIFACT }}
61
+ path : ${{ env.REPORTS_DIR }}
62
+ if-no-files-found : error
0 commit comments