1.1.0 RC 1 #9
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
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
release: | |
types: published | |
env: | |
CFLAGS: -Wno-error=implicit-function-declaration | |
jobs: | |
#----------------------------------------------------------------------------- | |
test: | |
name: Test / ${{ matrix.os.name }} / Python ${{ matrix.python.version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- {name: 'ubuntu-22.04', pip_cache: '~/.cache/pip'} | |
- {name: 'windows-2022', pip_cache: '~\AppData\Local\pip\Cache'} | |
- {name: 'macos-13', pip_cache: '~/Library/Caches/pip'} | |
python: | |
- {version: '3.9', requirements: 'requirements-test-3_11.txt'} | |
- {version: '3.10', requirements: 'requirements-test-3_11.txt'} | |
- {version: '3.11', requirements: 'requirements-test-3_11.txt'} | |
- {version: '3.12', requirements: 'requirements-test-3_11.txt'} | |
# - {version: '3.12', requirements: 'requirements-test-3_11-np2.txt'} | |
runs-on: ${{ matrix.os.name }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python.version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.os.pip_cache }} | |
key: test-pip-${{ matrix.os.name }}-${{ matrix.python.version }}-${{ hashFiles(matrix.python.requirements, '.github/workflows/ci.yml') }} | |
restore-keys: test-pip-${{ matrix.os.name }}-${{ matrix.python.version }}- | |
- run: | | |
python -m pip install --upgrade pip | |
pip install -r ${{ matrix.python.requirements }} | |
- run: inv test --cov | |
- uses: codecov/codecov-action@v3 | |
with: | |
# token: 6de39346-7381-441d-80d3-a6c0c051be2d | |
files: coverage.xml | |
fail_ci_if_error: false | |
verbose: true | |
#----------------------------------------------------------------------------- | |
checks: | |
name: ${{ matrix.checks.name }} / ${{ matrix.os.name }} / Python ${{ matrix.python.version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- {name: 'ubuntu-22.04', pip_cache: '~/.cache/pip'} | |
python: | |
- {version: '3.11', requirements: 'requirements-dev-3_11.txt'} | |
checks: | |
- {name: 'Quality', command: 'inv quality'} | |
- {name: 'Package', command: 'inv build'} | |
runs-on: ${{ matrix.os.name }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python.version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.os.pip_cache }} | |
key: quality-pip-${{ hashFiles(matrix.python.requirements, '.github/workflows/ci.yml') }} | |
restore-keys: quality-pip- | |
- run: | | |
python -m pip install --upgrade pip | |
pip install -r ${{ matrix.python.requirements }} | |
- run: ${{ matrix.checks.command }} | |
- uses: actions/upload-artifact@v3 | |
if: matrix.checks.name == 'Package' | |
with: | |
name: dist | |
path: dist | |
#----------------------------------------------------------------------------- | |
upload: | |
name: Publish | |
if: github.event_name == 'release' | |
needs: [test, checks] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} | |
skip_existing: true |