Mercurial > public > bitcaviar-plus
annotate .github/workflows/python-publish.yml @ 25:c75ee64c812c
add tests job
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 21 Nov 2021 18:38:18 +0100 |
parents | d1f527020d54 |
children | 30535f42d0ff |
rev | line source |
---|---|
18 | 1 name: Upload Python Package |
2 | |
3 on: | |
4 push: | |
5 tags: [ '*.*.*' ] | |
6 | |
7 jobs: | |
8 deploy: | |
9 | |
10 runs-on: ubuntu-latest | |
11 | |
12 steps: | |
13 - uses: actions/checkout@v2 | |
14 - name: Set up Python | |
15 uses: actions/setup-python@v2 | |
16 with: | |
17 python-version: '3.x' | |
18 - name: Install dependencies | |
19 run: | | |
20 python -m pip install --upgrade pip | |
21 pip install build | |
25
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
22 python -m pip install flake8 |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
23 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
24 - name: Lint with flake8 |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
25 run: | |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
26 # stop the build if there are Python syntax errors or undefined names |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
27 flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
28 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
29 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
30 - name: Test |
c75ee64c812c
add tests job
Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
parents:
18
diff
changeset
|
31 run: python -m unittest discover |
18 | 32 - name: Build package |
33 run: python -m build | |
34 - name: Publish package | |
35 uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
36 with: | |
37 user: __token__ | |
38 password: ${{ secrets.PYPI_API_TOKEN }} |