Skip to content

Build fixes

Build fixes #156

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.11"]
steps:
- name: Install prerequisites
run: |
sudo apt-get update && sudo apt-get install libgtk-3-0 libnotify4
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@v2
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-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- 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@v2
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 }}