Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
104 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
relative_files = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,115 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.5', '3.6', '3.7', '3.8'] | ||
test-python: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install coveralls | ||
- name: Test | ||
run: | | ||
coverage run --source=asn1tools setup.py test | ||
- name: Coveralls | ||
uses: AndreMiras/coveralls-python-action@develop | ||
|
||
test-python-sdist: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
pip install -r requirements.txt | ||
- name: Test | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
make test-sdist | ||
test-c: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
pytest | ||
sudo apt-get install -qq valgrind -y | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Test | ||
run: | | ||
make test-c | ||
make -C examples/benchmarks/c_source | ||
(cd tests && bash <(curl -s https://codecov.io/bash) -X coveragepy) | ||
examples: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Test | ||
run: | | ||
(cd examples/benchmarks/packages && wget https://github.com/ANSSI-FR/pycrate/archive/master.zip && unzip -qq master.zip) | ||
env PYTHONPATH=.:examples/benchmarks/packages/pycrate-master python examples/benchmarks/packages/ber.py | ||
env PYTHONPATH=.:examples/benchmarks/packages/pycrate-master python examples/benchmarks/packages/uper.py | ||
env PYTHONPATH=. python examples/benchmarks/codecs.py | ||
env PYTHONPATH=. python examples/benchmarks/question/question.py | ||
env PYTHONPATH=. python examples/hello_world.py | ||
env PYTHONPATH=. python examples/x509_pem.py | ||
env PYTHONPATH=. python examples/compact_extensions_uper/main.py | ||
env PYTHONPATH=. python examples/programming_types/main.py | ||
release: | ||
needs: [test-python, test-python-sdist, test-c, examples] | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- 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 --outdir dist/ . | ||
- 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 }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters