Files
Tirsvad 1bad75c367
TirSystem/github-action: Publish wiki / publish-wiki (push) Skipped
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Skipped
Validate workflows / validate (pull_request) Successful in 18s
Add timeouts to every job and pin actions/checkout to an exact tag
Findings of QC-WF-001 (criteria 8 and 14) applied to the workflows of this
repository and to the two scoped workflows:

- timeout-minutes on every job: quality-checks 15, release 15,
  validate-workflows 10, sync-milestones 15, publish-wiki 10,
  sync-github-metadata 5.
- actions/checkout@v4 becomes actions/checkout@v4.2.2.

No change to inputs, secrets or behaviour. The 6-line run blocks of
sync-milestones.yml move to a script in the framework in a separate change.
2026-10-11 12:49:24 +08:00

76 lines
2.4 KiB
YAML

name: Quality checks
# Reusable workflow (ADR-0005). A repository calls it with
#
# jobs:
# quality:
# uses: TirSystem/github-action/.gitea/workflows/quality-checks.yml@v1
#
# It checks the Python and shell files of the repository with pinned tools,
# changes no file and needs no secret.
on:
workflow_call:
inputs:
languages:
description: "Comma list of the languages to check: python, shell"
type: string
default: "python,shell"
working-directory:
description: "Directory, relative to the repository root, whose files are checked"
type: string
default: "."
ruff-version:
description: "Version of ruff (Python lint and format)"
type: string
default: "0.6.9"
mypy-version:
description: "Version of mypy (Python types, --strict)"
type: string
default: "1.11.2"
shellcheck-py-version:
description: "Version of the shellcheck-py package (ShellCheck 0.10.0)"
type: string
default: "0.10.0.1"
shfmt-py-version:
description: "Version of the shfmt-py package (shfmt 3.11.0)"
type: string
default: "3.11.0.2"
tools-ref:
description: "Tag or branch of TirSystem/github-action whose tools/quality-checks.sh is run; pin it to the exact tag together with the workflow"
type: string
default: "v1"
jobs:
quality-checks:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 15
env:
LANGUAGES: ${{ inputs.languages }}
WORKING_DIRECTORY: ${{ inputs.working-directory }}
RUFF_VERSION: ${{ inputs.ruff-version }}
MYPY_VERSION: ${{ inputs.mypy-version }}
SHELLCHECK_PY_VERSION: ${{ inputs.shellcheck-py-version }}
SHFMT_PY_VERSION: ${{ inputs.shfmt-py-version }}
QC_VENV: /tmp/quality-tools
steps:
- name: Check out the repository
uses: actions/checkout@v4.2.2
- name: Fetch the shared script
uses: actions/checkout@v4.2.2
with:
repository: TirSystem/github-action
ref: ${{ inputs.tools-ref }}
path: shared-scripts
- name: Validate the inputs
run: bash shared-scripts/tools/quality-checks.sh validate
- name: Install the tools
run: bash shared-scripts/tools/quality-checks.sh install
- name: Run the checks
run: bash shared-scripts/tools/quality-checks.sh run