-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.08 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Test suite
on:
push:
branches: [main]
pull_request:
branches: [main]
# To trigger jobs manually
workflow_dispatch:
jobs:
pre-commit:
name: Pre-Commit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Pre-Commit
run: |
python -m pip install pip --upgrade
python -m pip install pre-commit
pre-commit run -a
- name: Analysis (git diff)
if: failure()
run: git diff
unit-tests:
name: UnitTests-Python-${{ matrix.python-version }}
needs: [ pre-commit ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ pypy3, 3.6, 3.7, 3.8 ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python-${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Unit Tests
run: |
python -m pip install -U setuptools wheel pytest pytest-cov
python -m pip install -e .[test]
pytest --cov=ghaction --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: coverage.xml
flags: unittests
name: ${{ github.run_id }}-py-${{ matrix.python-version }}
package:
name: Build & Verify Package
needs: [ unit-tests ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Build and verify with twine
run: |
python -m pip install pip --upgrade
python -m pip install twine setuptools wheel --upgrade
python setup.py sdist bdist_wheel
ls -l dist
python -m twine check dist/*