Skip to content

quality-checks

quality-checks #536

Workflow file for this run

---
name: quality-checks
on:
pull_request:
push:
branches:
- main
workflow_call:
inputs:
ref:
required: true
type: string
workflow_dispatch:
inputs:
ref:
description: A git reference to check out.
default: main
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
mattrix-value: ${{ steps.baipp.outputs.supported_python_classifiers_json_job_matrix_value }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: hynek/build-and-inspect-python-package@v2
id: baipp
debug:
needs: ["build"]
runs-on: ubuntu-latest
steps:
- run: echo ${{ needs.build.outputs.python-versions }}
- run: echo ${{ needs.build.outputs.matrix-value }}
unit-tests:
needs: ["build"]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(needs.build.outputs.python-versions) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: extractions/setup-just@v2
- run: pipx install hatch
- name: Download built packages from the build job.
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- run: |
rm -r _delb delb
test "$(ls 'dist/delb-*.whl' | wc -l)" -eq 1
ln -s dist/delb-*.whl delb.whl
just pytest
other-quality-checks:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- code-lint
- doctest
- mypy
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: extractions/setup-just@v2
- run: pipx install hatch
- run: just ${{ matrix.target }}
...