build(deps): update dependency tox-gh to v1.4.4 #910
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: test | |
on: | |
push: | |
branches: | |
- "main" | |
- "feature/*" | |
- "hotfix/*" | |
- "release/*" | |
- "renovate/*" | |
pull_request: | |
# Cancel currently-running builds when pushing new commits to a PR or branch | |
# https://stackoverflow.com/a/72408109 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: conventional commits | |
uses: webiny/action-conventional-commits@v1.3.0 | |
with: | |
allowed-commit-types: "build,chore,ci,docs,feat,fix,perf,refactor,style,test" | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Configure environment | |
run: | | |
echo "::group::Begin snap install" | |
echo "Installing snaps in the background while running apt and pip..." | |
sudo snap install --no-wait --classic pyright | |
sudo snap install --no-wait codespell shellcheck ruff | |
echo "::endgroup::" | |
echo "::group::pip install" | |
python -m pip install tox | |
echo "::endgroup::" | |
echo "::group::Create virtual environments for linting processes." | |
tox run --colored yes -m lint --notest | |
echo "::endgroup::" | |
echo "::group::Wait for snap to complete" | |
snap watch --last=install | |
echo "::endgroup::" | |
- name: Run linters | |
run: tox run --skip-pkg-install --no-list-dependencies --colored yes -m lint | |
unit: | |
strategy: | |
matrix: | |
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.10 | |
3.12 | |
3.13-dev | |
cache: 'pip' | |
- name: Configure environment | |
run: | | |
echo "::group::pip install" | |
python -m pip install tox | |
echo "::endgroup::" | |
mkdir -p results | |
- name: Setup Tox environments | |
run: tox run --colored yes -m tests --notest | |
- name: Test with tox | |
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m unit-tests | |
env: | |
PYTEST_ADDOPTS: "--no-header -vv -rN" | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
directory: ./results/ | |
files: coverage*.xml | |
- name: Upload test results | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: unit-test-results-${{ matrix.platform }} | |
path: results/ | |
integration: | |
strategy: | |
matrix: | |
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Check out code | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.10 | |
3.12 | |
3.13-dev | |
cache: 'pip' | |
- name: Configure environment | |
run: | | |
echo "::group::pip install" | |
python -m pip install tox | |
echo "::endgroup::" | |
mkdir -p results | |
- name: Setup Tox environments | |
run: tox run --colored yes -m tests --notest | |
- name: Test with tox | |
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m integration-tests | |
env: | |
PYTEST_ADDOPTS: "--no-header -vv -rN" | |
- name: Upload test results | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: integration-test-results-${{ matrix.platform }} | |
path: results/ |