1+ name : build
2+ on :
3+ push :
4+ branches : [master]
5+ pull_request :
6+ branches : [master]
7+
8+ jobs :
9+ test :
10+ runs-on : ${{ matrix.os }}
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ python-version : ['3.9', '3.10', '3.11']
15+ os : [ubuntu-latest]
16+
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v2
20+
21+ - name : Set up Python ${{ matrix.python-version }}
22+ uses : actions/setup-python@v2
23+ with :
24+ python-version : ${{ matrix.python-version }}
25+
26+ - name : Set up Rabbitmq
27+ uses : nijel/rabbitmq-action@v1.0.0
28+
29+ - name : Install dependencies
30+ run : |
31+ pip install -r requirements.txt
32+ pip install coveralls
33+
34+ - name : Run tests
35+ run : coverage run -m unittest discover -s tests -t tests
36+
37+ - name : Upload coverage data to coveralls.io
38+ run : coveralls --service=github
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+ COVERALLS_FLAG_NAME : ${{ matrix.os }} - ${{ matrix.python-version }}
42+ COVERALLS_PARALLEL : true
43+
44+ lint :
45+ name : Run Linters
46+ runs-on : ubuntu-latest
47+ steps :
48+ - name : Checkout
49+ uses : actions/checkout@v2
50+
51+ - name : Super-Linter
52+ uses : github/super-linter@v4.2.2
53+ env :
54+ VALIDATE_PYTHON_BLACK : true
55+ DEFAULT_BRANCH : master
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+
58+ coveralls :
59+ name : Indicate completion to coveralls.io
60+ needs : test
61+ runs-on : ubuntu-latest
62+ container : python:3-slim
63+ steps :
64+ - name : Finished
65+ run : |
66+ pip3 install --upgrade coveralls
67+ coveralls --finish
68+ env :
69+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
70+
71+ release :
72+ name : Release
73+ runs-on : ubuntu-latest
74+ needs : [ test, coveralls ]
75+ steps :
76+ - name : Checkout
77+ uses : actions/checkout@v2
78+ with :
79+ fetch-depth : 0
80+
81+ - name : Setup Node.js
82+ uses : actions/setup-node@v2
83+ with :
84+ node-version : ' 18'
85+
86+ - name : Setup
87+ 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
88+
89+ - name : Set up python
90+ uses : actions/setup-python@v2
91+ with :
92+ python-version : ' 3.10'
93+
94+ - name : Install setuptools
95+ run : python -m pip install --upgrade setuptools wheel twine
96+
97+ - name : Release
98+ env :
99+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
101+ run : npx semantic-release
0 commit comments