argon2-cffi/.github/workflows/main.yml
Hynek Schlawack 1133f3c2ba
Redo CI (#128)
* Update .gitignore

* Simplify packaging, move mypy config to pyproject.toml

* Reflow Tidelift spiel

* Freshen up contribution guide

* Update CI

* Modernize tox & CI

* 3.11

* Don't pass args to build in CI

* oops

* Add wheel/dist inspection

* Simplify conf.py

* fix

* simplify

* Clarify license

* cleanup

* docs

* add missing _

* parallel output sucks
2022-08-19 09:15:15 +02:00

143 lines
3.6 KiB
YAML

---
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
FORCE_COLOR: "1" # Make tools pretty.
TOX_TESTENV_PASSENV: FORCE_COLOR
PYTHON_LATEST: "3.10"
jobs:
tests:
name: tox on ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
[
"3.6",
"3.7",
"3.8",
"3.9",
"3.10",
"3.11.0-beta - 3.11",
"pypy-3.7",
"pypy-3.8",
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade virtualenv tox tox-gh-actions
- run: python -m tox
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: .coverage.*
if-no-files-found: ignore
coverage:
name: Combine & check coverage.
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# Use latest Python, so it understands all syntax.
python-version: ${{env.PYTHON_LATEST}}
- run: python -m pip install --upgrade coverage[toml]
- uses: actions/download-artifact@v3
with:
name: coverage-data
- name: Combine coverage & fail if it's <100%.
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v3
with:
name: html-report
path: htmlcov
if: ${{ failure() }}
system-package:
name: Install & test with system package of Argon2.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{env.PYTHON_LATEST}}
- name: Install dependencies
run: |
sudo apt-get install libargon2-0 libargon2-0-dev
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade virtualenv tox
- run: python -m tox -e system-argon2
package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{env.PYTHON_LATEST}}
- run: python -m pip install build twine check-wheel-contents wheel
- run: python -m build
- run: ls -l dist
- run: check-wheel-contents dist/*.whl
- name: Check long_description
run: python -m twine check dist/*
- name: Inspect sdist & wheel contents.
run: |
cd dist
mkdir out
python -m wheel unpack --dest out *.whl
tar xf *.tar.gz -C out
tree -a out
install-dev:
name: Verify dev env
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{env.PYTHON_LATEST}}
- run: python -m pip install -e .[dev]
- run: python -m argon2 -n 1 -t 1 -m 8 -p 1