Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da7efc1120 | ||
|
|
e406d65f6a | ||
|
|
51e546e9f5 | ||
|
|
16811c53fa | ||
|
|
7c2604108c | ||
|
|
9b063bf58f |
+53
-46
@@ -1,46 +1,53 @@
|
||||
# Continuous integration for the squirrel census project: runs the pytest tests
|
||||
# on Python 3.13 for every push and pull request. Read by Gitea Actions (a
|
||||
# runner must be registered for the repository). It changes nothing outside the
|
||||
# repository and uses no secret. Decision: MIL-001 task "Add CI workflow".
|
||||
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
||||
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: "3.13"
|
||||
PIP_VERSION: "26.2.1"
|
||||
|
||||
concurrency:
|
||||
group: tests-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pytest:
|
||||
name: Run the tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Create the virtual environment and install
|
||||
run: |
|
||||
python -m venv .venv
|
||||
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
||||
.venv/bin/python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Run the tests
|
||||
run: .venv/bin/python -m pytest
|
||||
# Continuous integration for the squirrel census project: lints the YAML and
|
||||
# workflow files and runs the pytest tests on Python 3.13 for every push and
|
||||
# pull request. Read by Gitea Actions (a runner must be registered for the
|
||||
# repository). It changes nothing outside the repository and uses no secret.
|
||||
# Decision: MIL-001 task "Add CI workflow".
|
||||
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
||||
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: "3.13"
|
||||
PIP_VERSION: "26.2.1"
|
||||
|
||||
concurrency:
|
||||
group: tests-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pytest:
|
||||
name: Run the tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Create the virtual environment and install
|
||||
run: |
|
||||
python -m venv .venv
|
||||
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
||||
.venv/bin/python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Lint the YAML files
|
||||
run: .venv/bin/python -m yamllint -c .yamllint.yml .gitea .yamllint.yml
|
||||
|
||||
- name: Lint the workflow files
|
||||
run: .venv/bin/actionlint .gitea/workflows/*.yml
|
||||
|
||||
- name: Run the tests
|
||||
run: .venv/bin/python -m pytest
|
||||
|
||||
+3
-3
@@ -6,6 +6,6 @@ rules:
|
||||
max: 100
|
||||
truthy:
|
||||
check-keys: false
|
||||
# Git on Windows checks files out with CRLF; the repository blob has LF.
|
||||
new-lines:
|
||||
type: platform
|
||||
# Line endings are normalised by git (LF in the repository, CRLF in some
|
||||
# Windows checkouts), so the rule would fail on a local checkout only.
|
||||
new-lines: disable
|
||||
|
||||
@@ -90,7 +90,8 @@ it is present.
|
||||
|
||||
The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every
|
||||
pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the
|
||||
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
project with `.[dev]`, lints the YAML and workflow files with `yamllint` and
|
||||
`actionlint`, and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
it also runs on GitHub Actions.
|
||||
|
||||
## Build the source documentation
|
||||
|
||||
@@ -16,7 +16,7 @@ document of a type. `Primary File` may contain a glob (e.g.
|
||||
| PP | Project Plan | docs/project-plan.md | 002 |
|
||||
| MIL | Milestone / Gateway | docs/milestones/*.md | 005 |
|
||||
| ADR | Architecture Decision Record | docs/adr/adr-NNNN-*.md | 0002 |
|
||||
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 031 |
|
||||
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 033 |
|
||||
| DICT | Domain Dictionary | docs/dictionary.md | 002 |
|
||||
| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 |
|
||||
| UCD | Use Case Diagram | docs/use-case-diagram.md | 002 |
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# RC Review of ci.yml, delta re-review for the lint steps (YAML)
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-031 |
|
||||
| CrossReference | [WF-MIL-001], [QC-YML-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [e406d65] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [WF-MIL-001]
|
||||
- Checklist used: [QC-YML-001]
|
||||
- Scope: delta re-review of criteria 3, 7, 10 and 15 of QC-YML-001: two lint steps added to ci.yml; earlier record RC-009
|
||||
- Language and domain: n/a
|
||||
- Language reviewer: none (the stand-in reviewer reads English and the `it` domain)
|
||||
- Mode: autonomous, not independent (reviewer: AI as stand-in for S01)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 3 | Passes `yamllint` (or the project's YAML linter) with its configuration committed next to the code and no unexplained `disable` comments (Mandatory) | Pass | `yamllint 1.38.0` with `.yamllint.yml` runs in CI on `.gitea` and `.yamllint.yml`; no errors. `new-lines` is disabled with a comment because git normalises line endings. |
|
||||
| 7 | Embedded program text (shell, Python, SQL, `jq`, and so on) in a value is at most five lines; a longer one is moved to a file of its own, in its own language, and the YAML calls it (Mandatory) | Pass | The two new `run:` blocks have one line each; the longest block is still 3 lines. |
|
||||
| 10 | The file validates against the schema of the consuming tool where one exists, and the schema or tool version is stated (Optional) | Pass | `actionlint` validates the workflow schema in CI. |
|
||||
| 15 | A change is exercised by a check that runs without the real target: a parse and schema test, or a dry run of the consuming tool (Optional) | Pass | yamllint and actionlint now run on every push and pull request without the real target. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — the changed rows pass; the other rows of RC-009 still hold.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| None | S01 | - |
|
||||
|
||||
---
|
||||
|
||||
[WF-MIL-001]: ../../../.gitea/workflows/ci.yml
|
||||
[QC-YML-001]: ../../../framework/qc/code/qc-yaml.md
|
||||
[e406d65]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel/commit/e406d65f6a53332750204ec3fd876ab2daa2bbd2
|
||||
@@ -0,0 +1,50 @@
|
||||
# RC Review of ci.yml, delta re-review for the lint steps (workflow)
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-032 |
|
||||
| CrossReference | [WF-MIL-001], [QC-WF-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [e406d65] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [WF-MIL-001]
|
||||
- Checklist used: [QC-WF-001]
|
||||
- Scope: delta re-review of criteria 5, 6, 17, 20, 22 and 24 of QC-WF-001: two lint steps added; earlier records RC-010, RC-025, RC-030
|
||||
- Language and domain: n/a
|
||||
- Language reviewer: none (the stand-in reviewer reads English and the `it` domain)
|
||||
- Mode: autonomous, not independent (reviewer: AI as stand-in for S01)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 5 | Every job and step has a descriptive `name`, unique within its job (Mandatory) | Pass | The new steps are named "Lint the YAML files" and "Lint the workflow files"; step names stay unique. |
|
||||
| 6 | The file passes `actionlint` (or the project's workflow validation test) and the tool version is stated (Mandatory) | Pass | `actionlint 1.7.12` runs in CI against `.gitea/workflows/*.yml` and passes. |
|
||||
| 17 | Tools and dependencies are installed at pinned versions; a version is a workflow input with a default or a value in one place (Mandatory) | Pass | `yamllint==1.38.0` and `actionlint-py==1.7.12.25` are exact pins in the dev extra of `pyproject.toml`. |
|
||||
| 20 | A `run:` block is within the limit on embedded program text of criterion 7 of [QC-YML-001]; a longer script is a file (`tools/`, or a shared repository fetched at a pinned ref) that the step calls with one command, and the workflow passes its settings through `env:` (Mandatory) | Pass | Each new `run:` block is one line. |
|
||||
| 22 | Every workflow feature used is verified on the instance that runs it, and the host and version are recorded; a feature the target hosts differ on is noted in the header (Mandatory) | Pass | The changed workflow completed with success on Gitea 1.27.3: run 1087 on pull request #39. |
|
||||
| 24 | A static test of the repository's workflows exists and runs on every pull request: valid YAML, required keys, explicit permissions and runner, no inline script above the limit (Optional) | Pass | `tests/test_workflow.py` still passes (33 tests) with the new steps. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — the changed rows pass; the other rows of RC-010, RC-025 and RC-030 still hold.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| None | S01 | - |
|
||||
|
||||
---
|
||||
|
||||
[WF-MIL-001]: ../../../.gitea/workflows/ci.yml
|
||||
[QC-WF-001]: ../../../framework/qc/code/qc-workflow.md
|
||||
[e406d65]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel/commit/e406d65f6a53332750204ec3fd876ab2daa2bbd2
|
||||
@@ -42,7 +42,7 @@ updated whenever an artifact instance is created or reviewed.
|
||||
| `src/squirrel/census.py`, `cli.py`, `__main__.py`, `tests/` | Python Source Code | - | - | [UC-001], [SSD-001], [ADR-0001] | - | [RC-024] |
|
||||
| `src/squirrel/constants.py`, `tests/test_constants.py` | Python Source Code | - | - | [MIL-001] | - | [RC-008] |
|
||||
| `tests/test_workflow.py` | Python Source Code | - | - | [MIL-001], [RC-010] | - | [RC-029] |
|
||||
| `.gitea/workflows/ci.yml` | CI Workflow | - | - | [MIL-001] | - | [RC-009], [RC-010], [RC-025], [RC-030] |
|
||||
| `.gitea/workflows/ci.yml` | CI Workflow | - | - | [MIL-001] | - | [RC-009], [RC-010], [RC-025], [RC-030], [RC-031], [RC-032] |
|
||||
|
||||
## Coverage Notes
|
||||
|
||||
@@ -98,3 +98,5 @@ updated whenever an artifact instance is created or reviewed.
|
||||
[RC-029]: ./reviews/rc-029-python-workflow-test.md
|
||||
[RC-030]: ./reviews/rc-030-ci-workflow-delta-24.md
|
||||
[dfaa840]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/025-squirrel/commit/dfaa8400c3bd24b086a2c3eab1bef1e4e7ea6b45
|
||||
[RC-031]: ./reviews/rc-031-ci-yaml-lint-steps.md
|
||||
[RC-032]: ./reviews/rc-032-ci-workflow-lint-steps.md
|
||||
|
||||
Reference in New Issue
Block a user