Skip to content

Commit

Permalink
quality-checks.yml: Employs the python-build-and-inspect-python-packa…
Browse files Browse the repository at this point in the history
…ge action
  • Loading branch information
funkyfuture committed Sep 23, 2024
1 parent 98f06e7 commit 4e61453
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,24 @@ on:

jobs:

build:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: hynek/build-and-inspect-python-package@v2
id: baipp

unit-tests:
needs: ["build"]
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8 # 2024-10
- 3.9 # 2025-10
- "3.10" # 2026-10
- "3.11" # 2027-10
- "3.12" # 2028-10
python-version: ${{ fromJson(needs.build.outputs.python-versions) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -40,8 +48,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- uses: extractions/setup-just@v2
- run: pip install hatch
- run: just pytest
- run: pipx install hatch
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- run: |
rm -r _delb delb
test "$(find dist -name 'delb-*.whl' | wc -l)" -eq 1
export WHEEL_PATH=$(find dist -name 'delb-*.whl')
just pytest
other-quality-checks:
runs-on: ubuntu-latest
Expand All @@ -59,7 +75,7 @@ jobs:
with:
python-version: "3.12"
- uses: extractions/setup-just@v2
- run: pip install hatch
- run: pipx install hatch
- run: just ${{ matrix.target }}

...
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default: tests


version := `hatch version`

ci-suffix := if env_var("CI") == "true" { "-ci" } else { "" }

# run benchmarks
benchmarks:
Expand Down Expand Up @@ -36,7 +36,7 @@ mypy:

# run the complete testsuite
pytest:
hatch run unit-tests:check
hatch run unit-tests{{ci-suffix}}:check

# release the current version on github & the PyPI
release: tests
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,10 @@ coverage-report = """
--cov=_delb --cov=delb \
tests
"""

[tool.hatch.envs.unit-tests-ci]
template = "unit-tests"
skip-install = true
extra-dependencies = [
"delb @ {root:uri}/{env:WHEEL_PATH}"
]

0 comments on commit 4e61453

Please sign in to comment.