Skip to content

TST: use exact commit sha for github actions #888

TST: use exact commit sha for github actions

TST: use exact commit sha for github actions #888

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
paths-ignore:
- README.md
concurrency:
# auto-cancel any in-progress job *on the same branch*
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- 3.14-dev
include:
- os: macos-latest
python-version: '3.10'
- os: macos-latest
python-version: '3.13'
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.13'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
- name: Build
run: uv sync --python-preference=only-system --group test --group covcheck --no-editable
- run: uv pip list
- run: uv run coverage run -m pytest --color=yes --doctest-modules
- name: Upload coverage data
# only using reports from ubuntu because
# combining reports from multiple platforms is tricky (or impossible ?)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: inifix_coverage_data-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.*
if-no-files-found: ignore
include-hidden-files: true
concurrency-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- '3.13'
- 3.14-dev
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
- name: Build
run: uv sync --python-preference=only-system --group test --group concurrency --no-editable
- run: uv pip list
- run: uv run pytest --color=yes --count 100 tests/test_concurrent.py
coverage:
name: Combine & check coverage
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
- run: uv sync --only-group covcheck
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: inifix_coverage_data-*
merge-multiple: true
- name: Check coverage
run: |
uv run coverage combine
uv run coverage html --skip-covered --skip-empty
uv run coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: inifix_coverage_report
path: htmlcov
if: ${{ failure() }}
type-check:
strategy:
matrix:
python-version:
- '3.10'
- '3.13'
runs-on: ubuntu-latest
name: type check
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.python-version }}-typecheck
cancel-in-progress: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
- name: Build
run: uv sync -p ${{ matrix.python-version }} --group typecheck --no-editable
- name: Run mypy
run: uv run mypy src/inifix
check-readme:
runs-on: ubuntu-latest
name: check README.md
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
- run: uv run scripts/check_readme.py