-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (69 loc) · 2.24 KB
/
main.yml
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
name: Build
on: push
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
sudo apt-get update && sudo apt-get install libnotify4 libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0
python -m pip install --upgrade pip
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython==4.2.1
pip install wheel coveralls
pip install -r requirements.txt
- name: Run unit test
run: |
rm -f .coverage
shopt -s globstar
for i in **/test_*.py; do
xvfb-run --auto-servernum python -m coverage run --source=asn1editor -a -m unittest $i -v
done
python -m coverage html -d coverage
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage/index.html
- name: Lint with flake8
run: |
pip install flake8
flake8 asn1editor --max-line-length=160
release:
name: Release to PyPI
needs: [ analyze ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Set up Python 3.11
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
git clean -dfx
python -m build --sdist --wheel --outdir dist/ .
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/*.whl
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
password: ${{ secrets.pypi_password }}