1
+ name : build
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+ pull_request :
7
+ branches : [ master ]
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ${{ matrix.os }}
12
+ strategy :
13
+ fail-fast : false
14
+ matrix :
15
+ python-version : [ 3.6, 3.7, 3.8, 3.9 ]
16
+ os : [ ubuntu-18.04, macOS-latest, windows-latest ]
17
+
18
+ steps :
19
+ - name : Checkout
20
+ uses : actions/checkout@v2
21
+
22
+ - name : Set up Python ${{ matrix.python-version }}
23
+ uses : actions/setup-python@v2
24
+ with :
25
+ python-version : ${{ matrix.python-version }}
26
+
27
+ - name : Install dependencies
28
+ run : |
29
+ pip install -r requirements.txt
30
+ pip install -r dev_requirements.txt --upgrade
31
+ pip install coveralls
32
+
33
+ - name : Run tests
34
+ run : pytest --cov flask_authz
35
+
36
+ - name : Upload coverage data to coveralls.io
37
+ run : coveralls --service=github
38
+ env :
39
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40
+ COVERALLS_FLAG_NAME : ${{ matrix.os }} - ${{ matrix.python-version }}
41
+ COVERALLS_PARALLEL : true
42
+
43
+ coveralls :
44
+ name : Indicate completion to coveralls.io
45
+ needs : test
46
+ runs-on : ubuntu-latest
47
+ container : python:3-slim
48
+ steps :
49
+ - name : Finished
50
+ run : |
51
+ pip3 install --upgrade coveralls
52
+ coveralls --finish
53
+ env :
54
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
+
56
+ release :
57
+ name : Release
58
+ runs-on : ubuntu-latest
59
+ needs : [ test, coveralls ]
60
+ steps :
61
+ - name : Checkout
62
+ uses : actions/checkout@v2
63
+ with :
64
+ fetch-depth : 0
65
+
66
+ - name : Setup Node.js
67
+ uses : actions/setup-node@v1
68
+
69
+ - name : Setup
70
+ run : npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi
71
+
72
+ - name : Set up python
73
+ uses : actions/setup-python@v2
74
+ with :
75
+ python-version : 3.8
76
+
77
+ - name : Install setuptools
78
+ run : python -m pip install --upgrade setuptools wheel twine
79
+
80
+ - name : Release
81
+ if : github.event_name == 'push'
82
+ env :
83
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84
+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
85
+ run : npx semantic-release
0 commit comments