MIL-001: repository setup and tooling #35

Merged
Tirsvad merged 7 commits from mil-001-repository-setup into main 2026-10-28 07:11:09 +01:00
5 changed files with 163 additions and 0 deletions
Showing only changes of commit 954966ead9 - Show all commits
+23
View File
@@ -0,0 +1,23 @@
# English comments: fails a pull request that adds a comment or docstring that
# is not English (the project's language rule for source code).
#
# Triggers: every pull request. Calls the reusable workflow of
# TirSystem/git-workflows at the major tag v2 (same organisation). It changes
# no file, needs no secret and writes one comment on the pull request.
# Implements MIL-001. Verified on the Gitea instance git.tirsystem.com.
name: English comments
on:
pull_request:
concurrency:
group: english-comments-${{ github.ref }}
cancel-in-progress: true
jobs:
english-comments:
name: Comments are English
permissions:
contents: read
pull-requests: write
uses: TirSystem/git-workflows/.gitea/workflows/english-comments.yml@v2
+27
View File
@@ -0,0 +1,27 @@
# Quality checks (ruff, mypy) for the Python files of this repository.
#
# Triggers: every pull request and every push to main.
# Calls the reusable workflow of TirSystem/git-workflows at the major tag v2
# (same organisation, the tag moves with compatible releases). It changes no
# file, needs no secret and writes nothing outside the repository.
# Implements MIL-001 (Go/No-Go criterion 5: CI evidence). Verified on the
# Gitea instance git.tirsystem.com.
name: Quality
on:
pull_request:
push:
branches: [main]
concurrency:
group: quality-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Quality checks
permissions:
contents: read
uses: TirSystem/git-workflows/.gitea/workflows/quality-checks.yml@v2
with:
languages: python
+55
View File
@@ -0,0 +1,55 @@
# Publish accepted milestones to the git host.
#
# Triggers: a push to main that changes docs/milestones/ or docs/sqa/reviews/,
# and a manual run (dry run by default). It runs the framework's
# ci-publish-milestones.sh, which creates or updates the Milestone and the
# Issues of every milestone that is Accepted with a Go review. Nothing is closed
# or deleted. Secret: TOKEN_FOR_GITEA_SYNC (a Gitea token with read and write on
# issues; S01 creates it in the repository settings). Changes outside the
# repository: Milestones and Issues on the git host. Copied from
# framework/templates/ci/sync-milestones.yml; implements MIL-001.
name: Publish accepted milestones
on:
push:
branches: [main]
paths:
- "docs/milestones/**"
- "docs/sqa/reviews/**"
workflow_dispatch:
inputs:
dry_run:
description: "Preview only: print the plan and create nothing"
type: boolean
default: true
concurrency:
group: publish-accepted-milestones
cancel-in-progress: false
jobs:
publish:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out the project and its framework submodule
uses: actions/checkout@v4.2.2
with:
submodules: recursive
token: ${{ secrets.TOKEN_FOR_GITEA_SYNC }}
- name: Make sure curl and jq are available
run: bash framework/scripts/ci-publish-milestones.sh ensure-tools
- name: Publish accepted milestones
env:
# Gitea reads GITEA_TOKEN, GitHub's gh reads GH_TOKEN; both come from
# the one secret named above.
GITEA_TOKEN: ${{ secrets.TOKEN_FOR_GITEA_SYNC }}
GH_TOKEN: ${{ secrets.TOKEN_FOR_GITEA_SYNC }}
# Empty on a push (a real run); "true" or "false" on a manual run.
DRY_RUN: ${{ inputs.dry_run }}
run: bash framework/scripts/ci-publish-milestones.sh publish
+54
View File
@@ -0,0 +1,54 @@
# Tests and code metrics.
#
# Triggers: every pull request (tests only) and every push to main (tests, then
# size and coverage badges). The tests run offline. Needs no secret. The metrics
# job commits three SVG badges to the badges branch of this repository through
# the reusable workflow of TirSystem/git-workflows at the major tag v2 (same
# organisation). Implements MIL-001. Verified on git.tirsystem.com.
name: Tests and code metrics
on:
pull_request:
push:
branches: [main]
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Run pytest with coverage
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Check out the repository
uses: actions/checkout@v4.2.2
- name: Set up Python 3.13
uses: actions/setup-python@v5.3.0
with:
python-version: "3.13"
- name: Install the project and its test tools
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
- name: Run the tests offline
run: python -m pytest --cov=scrape_movies --cov-report=xml
- name: Keep the coverage report
uses: actions/upload-artifact@v4.6.2
with:
name: coverage
path: coverage.xml
metrics:
name: Code metrics badges
if: ${{ github.event_name == 'push' }}
needs: tests
permissions:
contents: write
uses: TirSystem/git-workflows/.gitea/workflows/code-metrics.yml@v2
with:
coverage-artifact: coverage
coverage-report: coverage.xml
+4
View File
@@ -0,0 +1,4 @@
extends: relaxed
rules:
line-length:
max: 120