Skip to content

v2.0.0rc1

v2.0.0rc1 #200

Workflow file for this run

name: Python package
on: [push]
jobs:
build-package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
id: baipp
outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13.0-alpha - 3.13.0"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
python -m pip install .[test]
- name: Test with pytest
run: pytest
- name: Test install
run: python -m pip install .
testwheel:
runs-on: ubuntu-latest
needs: build-package
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13.0-alpha - 3.13.0"]
steps:
- name: Download pre-built packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Extract source tarball
run: tar xf dist/*.tar.gz --strip-components=1
- name: Remove source code
run: rm -R flag
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: python -Im pip install tox
- name: Run tox on wheel
run: python -Im tox run --installpkg dist/*.whl
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test] .[coverage]
- name: Generate coverage
run: coverage run -m pytest
- name: Submit codacy
run: |
coverage xml
python-codacy-coverage -r coverage.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
continue-on-error: true
- name: Coveralls
uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Codecov
uses: codecov/codecov-action@v4
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2
continue-on-error: true
with:
args: >
-Dsonar.organization=cvzi-github
-Dsonar.projectKey=cvzi_flag
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.sources=flag
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.test.exclusions=tests/**
-Dsonar.tests=tests/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}