mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 22:37:29 +00:00
Merge branch 'main' of github.com:infinito-nexus/core into fix/users-applications.yml
This commit is contained in:
16 files changed
+223
-161
No files matched your search
@@ -11,6 +11,7 @@ on:
|
||||
- "feature/**"
|
||||
- "hotfix/**"
|
||||
- "fix/**"
|
||||
- "chore/**"
|
||||
- "alert-autofix-*"
|
||||
|
||||
permissions:
|
||||
@@ -20,8 +21,9 @@ permissions:
|
||||
security-events: write
|
||||
|
||||
jobs:
|
||||
# Skip a branch-creation push only when the pushed commit is already
|
||||
# contained in origin/main. Fresh commits outside main still run CI.
|
||||
# Skip CI when the push is to main and CI_RUN_ON_MAIN is not 'true', or
|
||||
# when the push is a branch creation whose commit is already in origin/main.
|
||||
# All other pushes run CI.
|
||||
run-policy:
|
||||
name: 🧭 Decide CI policy
|
||||
runs-on: ubuntu-latest
|
||||
@@ -46,11 +48,12 @@ jobs:
|
||||
id: decide
|
||||
env:
|
||||
GITHUB_EVENT_CREATED: ${{ github.event.created }}
|
||||
CI_RUN_ON_MAIN: ${{ vars.CI_RUN_ON_MAIN }}
|
||||
shell: bash
|
||||
run: bash scripts/meta/resolve/push_ci_policy.sh
|
||||
|
||||
skip-branch-creation-from-main:
|
||||
name: ⏭️ Skip branch creation from main
|
||||
skip-ci:
|
||||
name: ⏭️ Skip CI
|
||||
needs: run-policy
|
||||
if: needs.run-policy.outputs.should_run != 'true'
|
||||
runs-on: ubuntu-latest
|
||||
@@ -59,7 +62,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "Skipping CI for branch creation because commit ${GITHUB_SHA} is already contained in origin/main."
|
||||
echo "Skipping CI for commit ${GITHUB_SHA}."
|
||||
echo "Reason: ${{ needs.run-policy.outputs.skip_reason }}"
|
||||
|
||||
pick-distro:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# GitHub workflow files 🔄
|
||||
|
||||
This page is the SPOT for repository rules that govern GitHub Actions workflow files under `.github/workflows/`.
|
||||
For the catalog of every workflow (description, triggers, inputs) see [actions.md](../../../tools/github/actions.md).
|
||||
For the catalog of every workflow (description, triggers, inputs) see [workflows.md](../../../tools/github/actions/workflows.md).
|
||||
For the script placement rule that applies to extracted shell helpers, see [scripst.md](../../scripst.md).
|
||||
|
||||
## Naming 🏷️
|
||||
|
||||
@@ -10,6 +10,7 @@ The branch prefix MUST match the type of change. The [PR workflow](pull-request.
|
||||
| `documentation` | Documentation-only changes | `**/*.md`, `**/*.rst` (outside agent paths) | Skips [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml), finishes green through the lightweight scope gate. |
|
||||
| `feature` | New features or enhancements | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. |
|
||||
| `fix` | Bug fixes | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. |
|
||||
| `chore` | Maintenance, dependency, and tooling updates (incl. branches created by [update.yml](../../../../.github/workflows/update.yml)) | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. |
|
||||
| `alert-autofix` | Automated alert-triggered fixes | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. |
|
||||
| `dependabot` | Automated dependency updates | `*` | Runs the full [ci-orchestrator](../../../../.github/workflows/ci-orchestrator.yml) pipeline. |
|
||||
|
||||
@@ -29,6 +30,7 @@ The full branch name MUST follow one of the patterns below, depending on whether
|
||||
| Role feature | `feature/<role>/<topic>` | `feature/web-app-matomo/ldap-integration` |
|
||||
| General fix | `fix/<topic>/<ticket-id>` | `fix/dns-resolution/taiga-123` |
|
||||
| Role fix | `fix/<role>/<topic>/<ticket-id>` | `fix/web-app-matomo/login-redirect/taiga-789` |
|
||||
| Chore | `chore/<topic>` | `chore/update-docker-image-versions` |
|
||||
| Alert autofix | `alert-autofix-<alert-id>` | `alert-autofix-261` |
|
||||
| Documentation | `documentation/<topic>` | `documentation/contributing-setup` |
|
||||
| Agent | `agent/<topic>` | `agent/improve-commit-instructions` |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Continuous Integration 🔄
|
||||
|
||||
This document describes the CI pipeline structure, entry points, and gates used in Infinito.Nexus. For the catalog of every workflow file (description, triggers, inputs) see [actions.md](../../tools/github/actions.md).
|
||||
This document describes the CI pipeline structure, entry points, and gates used in Infinito.Nexus. For the catalog of every workflow file (description, triggers, inputs) see [workflows.md](../../tools/github/actions/workflows.md).
|
||||
|
||||
## Overview 🗺️
|
||||
|
||||
@@ -104,12 +104,9 @@ The final `done` job aggregates all deploy, install, and development gates. CI i
|
||||
|
||||
- PR pipelines use `cancel-in-progress: true` so only the newest run per PR and event type is active.
|
||||
- The orchestrator uses `cancel-in-progress: false` to avoid interrupting long-running deploy tests mid-flight.
|
||||
- The push entry workflow (`entry-push-latest.yml`) defaults to `cancel-in-progress: true` but respects the
|
||||
repository variable `CI_CANCEL_IN_PROGRESS`. Set it to `false` under
|
||||
**Settings → Secrets and variables → Actions → Variables** to prevent in-progress runs from being cancelled
|
||||
on the `main` / feature branches. Any other value (or no value) keeps the default cancel behaviour.
|
||||
- The push entry workflow (`entry-push-latest.yml`) defaults to `cancel-in-progress: true` but respects the repository variable `CI_CANCEL_IN_PROGRESS`.
|
||||
|
||||
See [configuration.md](../../tools/github/branch/configuration.md) for all repository variables that control CI behaviour.
|
||||
See [configuration.md](../../tools/github/actions/configuration.md) for all repository variables that control CI behaviour.
|
||||
|
||||
## Fork PRs 🍴
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# GitHub governance guides 🛡️
|
||||
|
||||
This directory contains contributor guidance for GitHub governance and repository controls.
|
||||
Its scope is branch protection, repository settings, and other platform rules that affect contributions.
|
||||
Its scope is branch protection, repository settings, GitHub Actions workflows and variables, and other platform rules that affect contributions.
|
||||
@@ -1,101 +0,0 @@
|
||||
# GitHub Actions 🎬
|
||||
|
||||
This page is the SPOT (single point of truth) for every GitHub Actions workflow defined under the [workflows directory](../../../../.github/workflows/). It lists each workflow together with a short description, its triggers, and the inputs it accepts.
|
||||
|
||||
For the CI **flow** (orchestrator stages, gates, fork-PR handling) see [pipeline.md](../../artefact/git/pipeline.md). For the **naming and shell-extraction conventions** that every workflow file MUST follow see [workflow.md](../../artefact/files/github/workflow.md). For the **branch-prefix scopes** referenced by the PR entry workflow see [branch.md](../../artefact/git/branch.md). For the **mirror architecture** referenced by the image workflows see [mirror.md](../../artefact/image/mirror.md).
|
||||
|
||||
## What GitHub Actions are 📘
|
||||
|
||||
GitHub Actions is GitHub's built-in CI/CD system. Each YAML file under `.github/workflows/` is one *workflow*; a workflow contains one or more *jobs*, and each job runs a sequence of *steps* on a hosted or self-hosted runner. Workflows are started by *triggers* declared in the `on:` section. The most common triggers in this repository are:
|
||||
|
||||
- `push`: fires when commits land on a branch.
|
||||
- `pull_request` / `pull_request_target`: fires on PR lifecycle events (`opened`, `synchronize`, `reopened`, `ready_for_review`, `closed`, `converted_to_draft`). The `_target` variant runs with the base-branch secrets and is used to grant fork PRs controlled access to privileged steps.
|
||||
- `schedule`: cron-based periodic runs (UTC).
|
||||
- `workflow_dispatch`: manual run from the GitHub UI or `gh workflow run`, optionally with inputs.
|
||||
- `workflow_call`: the workflow is a *reusable workflow* and is only started by another workflow that calls it via `uses:`.
|
||||
- `delete`: fires when a branch or tag is deleted.
|
||||
|
||||
Workflows communicate through *inputs* (on `workflow_call` / `workflow_dispatch`), *outputs*, *concurrency groups* (which cancel or serialize runs with the same group key), and the `GITHUB_TOKEN` / repository secrets and variables. The entry points of this repository (`entry-*.yml`) translate external triggers into a call to the central [ci-orchestrator.yml](../../../../.github/workflows/ci-orchestrator.yml). Most other workflows are reusable building blocks invoked from the orchestrator.
|
||||
|
||||
## Workflow catalog 📚
|
||||
|
||||
Trigger column legend: **auto** = fires automatically (push, pull_request, schedule, delete); **manual** = `workflow_dispatch`; **reusable** = `workflow_call`. Multiple values mean the workflow accepts any of them.
|
||||
|
||||
### Entry points 🚪
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [entry-pull-request-change.yml](../../../../.github/workflows/entry-pull-request-change.yml): `⚡ CI: Pull Request` | Detects PR scope from changed files + branch prefix, then conditionally calls the orchestrator. | auto (`pull_request`, `pull_request_target`: opened, synchronize, reopened, ready_for_review) | none |
|
||||
| [entry-push-latest.yml](../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` repository variable. | auto (`push`) | none |
|
||||
| [entry-manual.yml](../../../../.github/workflows/entry-manual.yml): `⚡ CI: Manual` | Manual dispatch of the full orchestrator for a chosen distro set and app whitelist. | manual | `distros` (default `debian`), `whitelist` (optional) |
|
||||
| [entry-pull-request-cancel.yml](../../../../.github/workflows/entry-pull-request-cancel.yml): `🚫 Cancel: PR Runs on Close` | Cancels active workflow runs for a PR when it is closed or converted to draft. | auto (`pull_request_target`: closed, converted_to_draft) | none |
|
||||
| [delete-branch.yml](../../../../.github/workflows/delete-branch.yml): `🚫 Cancel: Runs on Branch Delete` | Enters the push-entry concurrency group for the deleted branch so that any in-flight run on it is cancelled; a fallback step cancels remaining runs via the API. | auto (`delete`) | none |
|
||||
|
||||
### Orchestration 🎵
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [ci-orchestrator.yml](../../../../.github/workflows/ci-orchestrator.yml): `🎵 CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests, install tests, development-environment test, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`) |
|
||||
|
||||
### Security and linting 🛡️🔍
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [security-codeql.yml](../../../../.github/workflows/security-codeql.yml): `🔒 Scan: CodeQL (Advanced)` | CodeQL static analysis. | reusable, auto (`push` to `main`) | none |
|
||||
| [lint-ansible.yml](../../../../.github/workflows/lint-ansible.yml): `🔍 Lint: Ansible` | Runs `make lint-ansible`. | reusable | none |
|
||||
| [lint-docker.yml](../../../../.github/workflows/lint-docker.yml): `🔍 Lint: Dockerfiles` | hadolint on `Dockerfile` with SARIF upload. | reusable | none |
|
||||
| [lint-python.yml](../../../../.github/workflows/lint-python.yml): `🔍 Lint: Python` | `ruff` over the Python sources. | reusable | none |
|
||||
| [lint-shell.yml](../../../../.github/workflows/lint-shell.yml): `🔍 Lint: Shell Scripts` | `shellcheck` over every `*.sh` file. | reusable | none |
|
||||
|
||||
### CI images 🐳
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [images-build-ci.yml](../../../../.github/workflows/images-build-ci.yml): `🐳 Build: CI Images (all distros)` | Builds the per-distro CI base images consumed by all test jobs. | reusable | `distros` (required), `checkout_ref` (optional), `image_tag` (default `ci-${github.sha}`), `concurrency_channel` (default `default`) |
|
||||
| [images-cleanup-ci.yml](../../../../.github/workflows/images-cleanup-ci.yml): `🧹 Images: Cleanup CI (GHCR)` | Deletes CI images from GHCR older than N days. | auto (`schedule`: weekly Mon 00:00 UTC), manual | `days` (default `7`) |
|
||||
|
||||
### Image mirroring 🪞
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [images-mirror-missing.yml](../../../../.github/workflows/images-mirror-missing.yml): `🪞 Mirror: Docker Hub → GHCR (only missing)` | Mirrors only the upstream images that are not yet in GHCR. Called from the orchestrator before deploy tests. | reusable | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `source_repository`, `source_ref`, plus throttling knobs |
|
||||
| [images-mirror-all.yml](../../../../.github/workflows/images-mirror-all.yml): `🪞 Mirror: Docker Hub → GHCR` | Full nightly mirror of every referenced upstream image into GHCR. | auto (`schedule`: daily 00:00 UTC), manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `images_per_hour` (throttle) |
|
||||
| [images-mirror-cleanup.yml](../../../../.github/workflows/images-mirror-cleanup.yml): `🧹 Images: Cleanup GHCR (Private)` | Deletes GHCR mirror packages by prefix and visibility. Supports `dry_run`. | manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `visibility` (`private`/`public`/`internal`, default `private`), `dry_run` |
|
||||
|
||||
### Code tests 🧪
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [test-code-unit.yml](../../../../.github/workflows/test-code-unit.yml): `🧪 Test: Code (Units)` | Runs `make test-unit` in the CI container. | reusable | none |
|
||||
| [test-code-integration.yml](../../../../.github/workflows/test-code-integration.yml): `🧪 Test: Code (Integration)` | Runs `make test-integration` in the CI container. | reusable | none |
|
||||
| [test-code-lint.yml](../../../../.github/workflows/test-code-lint.yml): `🧪 Test: Code (Lint)` | Runs the project's own lint tests (not the external linters). | reusable | none |
|
||||
| [test-code-external.yml](../../../../.github/workflows/test-code-external.yml): `🧪 Test: Code (External)` | Runs `make test-external` against external services. | reusable, manual | none |
|
||||
|
||||
### Infrastructure tests 🌐📦💻📥
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [test-dns.yml](../../../../.github/workflows/test-dns.yml): `💬 Test: DNS` | Validates DNS resolution across target distributions. | reusable, manual | `distros` (required on call; default `debian` on manual) |
|
||||
| [test-deploy-server.yml](../../../../.github/workflows/test-deploy-server.yml): `📦 Test: Deploy (server)` | Deploy test for server and `web-*` roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-universal.yml](../../../../.github/workflows/test-deploy-universal.yml): `📦 Test: Deploy (universal)` | Deploy test for shared system roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-workstation.yml](../../../../.github/workflows/test-deploy-workstation.yml): `📦 Test: Deploy (workstation)` | Deploy test for workstation and `desk-*` roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-local.yml](../../../../.github/workflows/test-deploy-local.yml): `📦 Test: Deploy (local)` | Local/self-hosted deploy test. Intended for `act` or manual dispatch, not part of the orchestrator. | manual | `test_deploy_type` (`server`/`universal`/`workstation`, default `server`), `distros` (default `debian`), `whitelist` (optional) |
|
||||
| [test-install-make.yml](../../../../.github/workflows/test-install-make.yml): `📥 Test: Install Make` | Validates the `make install` entry points. | reusable | none |
|
||||
| [test-install-pkgmgr.yml](../../../../.github/workflows/test-install-pkgmgr.yml): `📥 Test: Install Package Manager` | Validates installation via the upstream package manager. | reusable | none |
|
||||
| [test-environment.yml](../../../../.github/workflows/test-environment.yml): `💻 Test: Development Environment` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none |
|
||||
|
||||
### Release and maintenance 🚀🔄
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [release-version.yml](../../../../.github/workflows/release-version.yml): `🚀 Release: Version Logic` | Releases a specific version tag (build + publish). Called from `entry-push-latest.yml` on tagged pushes. | reusable, manual | `tag` (required, e.g. `v1.2.3`) |
|
||||
| [release-highest.yml](../../../../.github/workflows/release-highest.yml): `🚀 Release: Highest Missing Version` | Scheduled backfill: finds the highest tag without a release and triggers `release-version.yml` for it. | auto (`schedule`: daily 00:00 UTC), manual | none |
|
||||
| [update.yml](../../../../.github/workflows/update.yml): `🔄 Update: Versions` | Updates Docker image versions and other pinned dependencies; opens an update PR. | auto (`push` to `main`, `schedule`: daily 00:30 UTC), manual | none |
|
||||
|
||||
## Changing workflows ✍️
|
||||
|
||||
Before adding or editing a workflow file:
|
||||
|
||||
1. Follow the naming schema and shell-extraction rules in [workflow.md](../../artefact/files/github/workflow.md).
|
||||
2. If the change affects the CI flow (stages, gates, order), also update [pipeline.md](../../artefact/git/pipeline.md).
|
||||
3. Update the relevant row in this page so the catalog stays accurate.
|
||||
@@ -0,0 +1,3 @@
|
||||
# GitHub Actions guides 🎬
|
||||
|
||||
This directory contains the SPOT for GitHub Actions in this repository: the workflow catalog and the repository variables that control CI behaviour.
|
||||
@@ -0,0 +1,75 @@
|
||||
# CI Configuration ⚙️
|
||||
|
||||
This page is the SPOT (single point of truth) for every repository variable that controls GitHub Actions CI behaviour in this repo. For the workflow catalog see [workflows.md](workflows.md); for the CI flow see [pipeline.md](../../../artefact/git/pipeline.md).
|
||||
|
||||
Repository variables are set under **Settings → Secrets and variables → Actions → Variables**.
|
||||
|
||||
## Variables 📋
|
||||
|
||||
| Variable | Workflow | Default (unset) | Set to activate |
|
||||
|---|---|---|---|
|
||||
| `CI_CANCEL_IN_PROGRESS` | [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml) | Cancels in-progress runs on new push | `false` to keep in-progress runs alive |
|
||||
| `CI_RUN_ON_MAIN` | [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml) | Pushes to `main` skip CI | `true` to run CI on `main` pushes too |
|
||||
|
||||
## `CI_CANCEL_IN_PROGRESS` 🛑
|
||||
|
||||
Controls whether a new push cancels an already-running CI pipeline on the same branch.
|
||||
|
||||
**Default behaviour (variable not set or set to any value other than `false`):**
|
||||
In-progress runs are cancelled when a new push arrives. This is the recommended setting for most workflows.
|
||||
|
||||
**To disable cancellation:**
|
||||
|
||||
1. Open the repository on GitHub.
|
||||
2. Go to **Settings → Secrets and variables → Actions**.
|
||||
3. Switch to the **Variables** tab.
|
||||
4. Click **New repository variable**.
|
||||
5. Set **Name** to `CI_CANCEL_IN_PROGRESS` and **Value** to `false`.
|
||||
6. Save.
|
||||
|
||||
**To re-enable cancellation:**
|
||||
|
||||
Delete the variable or change its value to anything other than `false` (e.g. `true`).
|
||||
|
||||
**How it works:**
|
||||
|
||||
```yaml
|
||||
cancel-in-progress: ${{ vars.CI_CANCEL_IN_PROGRESS != 'false' }}
|
||||
```
|
||||
|
||||
| Variable value | Expression result | Behaviour |
|
||||
|---|---|---|
|
||||
| *(not set / empty)* | `'' != 'false'` → `true` | Cancels in-progress runs ✓ |
|
||||
| `false` | `'false' != 'false'` → `false` | Does **not** cancel ✓ |
|
||||
| `true` | `'true' != 'false'` → `true` | Cancels in-progress runs ✓ |
|
||||
|
||||
## `CI_RUN_ON_MAIN` 🎯
|
||||
|
||||
Controls whether pushes to `main` trigger the CI pipeline. Pushes to all other branches covered by the workflow (`feature/**`, `hotfix/**`, `fix/**`, `alert-autofix-*`) are unaffected.
|
||||
|
||||
**Default behaviour (variable not set or set to any value other than `true`):**
|
||||
Pushes to `main` are gated out at the `run-policy` job and CI is skipped.
|
||||
|
||||
**To enable CI on `main` pushes:**
|
||||
|
||||
1. Open the repository on GitHub.
|
||||
2. Go to **Settings → Secrets and variables → Actions**.
|
||||
3. Switch to the **Variables** tab.
|
||||
4. Click **New repository variable**.
|
||||
5. Set **Name** to `CI_RUN_ON_MAIN` and **Value** to `true`.
|
||||
6. Save.
|
||||
|
||||
**To disable again:**
|
||||
|
||||
Delete the variable or change its value to anything other than `true`.
|
||||
|
||||
**How it works:**
|
||||
|
||||
The gate is applied inside [push_ci_policy.sh](../../../../../scripts/meta/resolve/push_ci_policy.sh), which the `run-policy` job invokes. When `GITHUB_REF == refs/heads/main` and `CI_RUN_ON_MAIN != 'true'`, the job emits `should_run=false` and every downstream job is skipped.
|
||||
|
||||
| Variable value | Ref is `main` | Behaviour |
|
||||
|---|---|---|
|
||||
| *(not set / empty)* | yes | CI skipped ✓ |
|
||||
| `true` | yes | CI runs ✓ |
|
||||
| any other value | yes | CI skipped ✓ |
|
||||
| *(any)* | no | Unaffected (CI runs per branch rules) ✓ |
|
||||
@@ -0,0 +1,102 @@
|
||||
# GitHub Actions 🎬
|
||||
|
||||
This page is the SPOT (single point of truth) for every GitHub Actions workflow defined under the [workflows directory](../../../../../.github/workflows/). It lists each workflow together with a short description, its triggers, and the inputs it accepts.
|
||||
|
||||
For the CI **flow** (orchestrator stages, gates, fork-PR handling) see [pipeline.md](../../../artefact/git/pipeline.md). For the **repository variables** that control CI behaviour see [configuration.md](configuration.md). For the **naming and shell-extraction conventions** that every workflow file MUST follow see [workflow.md](../../../artefact/files/github/workflow.md). For the **branch-prefix scopes** referenced by the PR entry workflow see [branch.md](../../../artefact/git/branch.md). For the **mirror architecture** referenced by the image workflows see [mirror.md](../../../artefact/image/mirror.md).
|
||||
|
||||
## What GitHub Actions are 📘
|
||||
|
||||
GitHub Actions is GitHub's built-in CI/CD system. Each YAML file under `.github/workflows/` is one *workflow*; a workflow contains one or more *jobs*, and each job runs a sequence of *steps* on a hosted or self-hosted runner. Workflows are started by *triggers* declared in the `on:` section. The most common triggers in this repository are:
|
||||
|
||||
- `push`: fires when commits land on a branch.
|
||||
- `pull_request` / `pull_request_target`: fires on PR lifecycle events (`opened`, `synchronize`, `reopened`, `ready_for_review`, `closed`, `converted_to_draft`). The `_target` variant runs with the base-branch secrets and is used to grant fork PRs controlled access to privileged steps.
|
||||
- `schedule`: cron-based periodic runs (UTC).
|
||||
- `workflow_dispatch`: manual run from the GitHub UI or `gh workflow run`, optionally with inputs.
|
||||
- `workflow_call`: the workflow is a *reusable workflow* and is only started by another workflow that calls it via `uses:`.
|
||||
- `delete`: fires when a branch or tag is deleted.
|
||||
|
||||
Workflows communicate through *inputs* (on `workflow_call` / `workflow_dispatch`), *outputs*, *concurrency groups* (which cancel or serialize runs with the same group key), and the `GITHUB_TOKEN` / repository secrets and variables. The entry points of this repository (`entry-*.yml`) translate external triggers into a call to the central [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml). Most other workflows are reusable building blocks invoked from the orchestrator.
|
||||
|
||||
## Workflow catalog 📚
|
||||
|
||||
Trigger column legend: **auto** = fires automatically (push, pull_request, schedule, delete); **manual** = `workflow_dispatch`; **reusable** = `workflow_call`. Multiple values mean the workflow accepts any of them.
|
||||
|
||||
### Entry points 🚪
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [entry-pull-request-change.yml](../../../../../.github/workflows/entry-pull-request-change.yml): `⚡ CI: Pull Request` | Detects PR scope from changed files + branch prefix, then conditionally calls the orchestrator. | auto (`pull_request`, `pull_request_target`: opened, synchronize, reopened, ready_for_review) | none |
|
||||
| [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml): `⚡ CI: Push` | Runs the orchestrator on pushes to `main`, `feature/**`, `hotfix/**`, `fix/**`, `chore/**`, `alert-autofix-*`; on tagged `main` it also calls `release-version.yml`. Respects the `CI_CANCEL_IN_PROGRESS` and `CI_RUN_ON_MAIN` repository variables, see [configuration.md](configuration.md). | auto (`push`) | none |
|
||||
| [entry-manual.yml](../../../../../.github/workflows/entry-manual.yml): `⚡ CI: Manual` | Manual dispatch of the full orchestrator for a chosen distro set and app whitelist. | manual | `distros` (default `debian`), `whitelist` (optional) |
|
||||
| [entry-pull-request-cancel.yml](../../../../../.github/workflows/entry-pull-request-cancel.yml): `🚫 Cancel: PR Runs on Close` | Cancels active workflow runs for a PR when it is closed or converted to draft. | auto (`pull_request_target`: closed, converted_to_draft) | none |
|
||||
| [delete-branch.yml](../../../../../.github/workflows/delete-branch.yml): `🚫 Cancel: Runs on Branch Delete` | Enters the push-entry concurrency group for the deleted branch so that any in-flight run on it is cancelled; a fallback step cancels remaining runs via the API. | auto (`delete`) | none |
|
||||
|
||||
### Orchestration 🎵
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml): `🎵 CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests, install tests, development-environment test, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`) |
|
||||
|
||||
### Security and linting 🛡️🔍
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [security-codeql.yml](../../../../../.github/workflows/security-codeql.yml): `🔒 Scan: CodeQL (Advanced)` | CodeQL static analysis. | reusable, auto (`push` to `main`) | none |
|
||||
| [lint-ansible.yml](../../../../../.github/workflows/lint-ansible.yml): `🔍 Lint: Ansible` | Runs `make lint-ansible`. | reusable | none |
|
||||
| [lint-docker.yml](../../../../../.github/workflows/lint-docker.yml): `🔍 Lint: Dockerfiles` | hadolint on `Dockerfile` with SARIF upload. | reusable | none |
|
||||
| [lint-python.yml](../../../../../.github/workflows/lint-python.yml): `🔍 Lint: Python` | `ruff` over the Python sources. | reusable | none |
|
||||
| [lint-shell.yml](../../../../../.github/workflows/lint-shell.yml): `🔍 Lint: Shell Scripts` | `shellcheck` over every `*.sh` file. | reusable | none |
|
||||
|
||||
### CI images 🐳
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [images-build-ci.yml](../../../../../.github/workflows/images-build-ci.yml): `🐳 Build: CI Images (all distros)` | Builds the per-distro CI base images consumed by all test jobs. | reusable | `distros` (required), `checkout_ref` (optional), `image_tag` (default `ci-${github.sha}`), `concurrency_channel` (default `default`) |
|
||||
| [images-cleanup-ci.yml](../../../../../.github/workflows/images-cleanup-ci.yml): `🧹 Images: Cleanup CI (GHCR)` | Deletes CI images from GHCR older than N days. | auto (`schedule`: weekly Mon 00:00 UTC), manual | `days` (default `7`) |
|
||||
|
||||
### Image mirroring 🪞
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [images-mirror-missing.yml](../../../../../.github/workflows/images-mirror-missing.yml): `🪞 Mirror: Docker Hub → GHCR (only missing)` | Mirrors only the upstream images that are not yet in GHCR. Called from the orchestrator before deploy tests. | reusable | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `source_repository`, `source_ref`, plus throttling knobs |
|
||||
| [images-mirror-all.yml](../../../../../.github/workflows/images-mirror-all.yml): `🪞 Mirror: Docker Hub → GHCR` | Full nightly mirror of every referenced upstream image into GHCR. | auto (`schedule`: daily 00:00 UTC), manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `repo_root` (default `.`), `images_per_hour` (throttle) |
|
||||
| [images-mirror-cleanup.yml](../../../../../.github/workflows/images-mirror-cleanup.yml): `🧹 Images: Cleanup GHCR (Private)` | Deletes GHCR mirror packages by prefix and visibility. Supports `dry_run`. | manual | `ghcr_namespace`, `ghcr_prefix` (default `mirror`), `visibility` (`private`/`public`/`internal`, default `private`), `dry_run` |
|
||||
|
||||
### Code tests 🧪
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [test-code-unit.yml](../../../../../.github/workflows/test-code-unit.yml): `🧪 Test: Code (Units)` | Runs `make test-unit` in the CI container. | reusable | none |
|
||||
| [test-code-integration.yml](../../../../../.github/workflows/test-code-integration.yml): `🧪 Test: Code (Integration)` | Runs `make test-integration` in the CI container. | reusable | none |
|
||||
| [test-code-lint.yml](../../../../../.github/workflows/test-code-lint.yml): `🧪 Test: Code (Lint)` | Runs the project's own lint tests (not the external linters). | reusable | none |
|
||||
| [test-code-external.yml](../../../../../.github/workflows/test-code-external.yml): `🧪 Test: Code (External)` | Runs `make test-external` against external services. | reusable, manual | none |
|
||||
|
||||
### Infrastructure tests 🌐📦💻📥
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [test-dns.yml](../../../../../.github/workflows/test-dns.yml): `💬 Test: DNS` | Validates DNS resolution across target distributions. | reusable, manual | `distros` (required on call; default `debian` on manual) |
|
||||
| [test-deploy-server.yml](../../../../../.github/workflows/test-deploy-server.yml): `📦 Test: Deploy (server)` | Deploy test for server and `web-*` roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-universal.yml](../../../../../.github/workflows/test-deploy-universal.yml): `📦 Test: Deploy (universal)` | Deploy test for shared system roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-workstation.yml](../../../../../.github/workflows/test-deploy-workstation.yml): `📦 Test: Deploy (workstation)` | Deploy test for workstation and `desk-*` roles. | reusable | `distros` (required), `whitelist` (optional) |
|
||||
| [test-deploy-local.yml](../../../../../.github/workflows/test-deploy-local.yml): `📦 Test: Deploy (local)` | Local/self-hosted deploy test. Intended for `act` or manual dispatch, not part of the orchestrator. | manual | `test_deploy_type` (`server`/`universal`/`workstation`, default `server`), `distros` (default `debian`), `whitelist` (optional) |
|
||||
| [test-install-make.yml](../../../../../.github/workflows/test-install-make.yml): `📥 Test: Install Make` | Validates the `make install` entry points. | reusable | none |
|
||||
| [test-install-pkgmgr.yml](../../../../../.github/workflows/test-install-pkgmgr.yml): `📥 Test: Install Package Manager` | Validates installation via the upstream package manager. | reusable | none |
|
||||
| [test-environment.yml](../../../../../.github/workflows/test-environment.yml): `💻 Test: Development Environment` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none |
|
||||
|
||||
### Release and maintenance 🚀🔄
|
||||
|
||||
| Workflow | Description | Trigger | Inputs |
|
||||
|---|---|---|---|
|
||||
| [release-version.yml](../../../../../.github/workflows/release-version.yml): `🚀 Release: Version Logic` | Releases a specific version tag (build + publish). Called from `entry-push-latest.yml` on tagged pushes. | reusable, manual | `tag` (required, e.g. `v1.2.3`) |
|
||||
| [release-highest.yml](../../../../../.github/workflows/release-highest.yml): `🚀 Release: Highest Missing Version` | Scheduled backfill: finds the highest tag without a release and triggers `release-version.yml` for it. | auto (`schedule`: daily 00:00 UTC), manual | none |
|
||||
| [update.yml](../../../../../.github/workflows/update.yml): `🔄 Update: Versions` | Updates Docker image versions and other pinned dependencies; opens an update PR. | auto (`push` to `main`, `schedule`: daily 00:30 UTC), manual | none |
|
||||
|
||||
## Changing workflows ✍️
|
||||
|
||||
Before adding or editing a workflow file:
|
||||
|
||||
1. Follow the naming schema and shell-extraction rules in [workflow.md](../../../artefact/files/github/workflow.md).
|
||||
2. If the change affects the CI flow (stages, gates, order), also update [pipeline.md](../../../artefact/git/pipeline.md).
|
||||
3. If the change adds or removes a repository variable, also update [configuration.md](configuration.md).
|
||||
4. Update the relevant row in this page so the catalog stays accurate.
|
||||
@@ -1,3 +1,3 @@
|
||||
# Branch Configuration 🌿
|
||||
# Branch Governance 🌿
|
||||
|
||||
This section documents the GitHub branch settings for this repository: the branch protection rules enforced on `main` and the repository variables that control CI behaviour.
|
||||
This section documents the branch protection rules enforced on `main`. For repository variables that control CI behaviour, see [configuration.md](../actions/configuration.md).
|
||||
@@ -1,37 +0,0 @@
|
||||
# CI Configuration ⚙️
|
||||
|
||||
This page documents the repository variables that control CI pipeline behaviour.
|
||||
Repository variables are set under **Settings → Secrets and variables → Actions → Variables**.
|
||||
|
||||
## `CI_CANCEL_IN_PROGRESS`
|
||||
|
||||
Controls whether a new push cancels an already-running CI pipeline on the same branch
|
||||
in [entry-push-latest.yml](../../../../../.github/workflows/entry-push-latest.yml).
|
||||
|
||||
**Default behaviour (variable not set or set to any value other than `false`):**
|
||||
In-progress runs are cancelled when a new push arrives. This is the recommended setting for most workflows.
|
||||
|
||||
**To disable cancellation:**
|
||||
|
||||
1. Open the repository on GitHub.
|
||||
2. Go to **Settings → Secrets and variables → Actions**.
|
||||
3. Switch to the **Variables** tab.
|
||||
4. Click **New repository variable**.
|
||||
5. Set **Name** to `CI_CANCEL_IN_PROGRESS` and **Value** to `false`.
|
||||
6. Save.
|
||||
|
||||
**To re-enable cancellation:**
|
||||
|
||||
Delete the variable or change its value to anything other than `false` (e.g. `true`).
|
||||
|
||||
**How it works:**
|
||||
|
||||
```yaml
|
||||
cancel-in-progress: ${{ vars.CI_CANCEL_IN_PROGRESS != 'false' }}
|
||||
```
|
||||
|
||||
| Variable value | Expression result | Behaviour |
|
||||
|---|---|---|
|
||||
| *(not set / empty)* | `'' != 'false'` → `true` | Cancels in-progress runs ✓ |
|
||||
| `false` | `'false' != 'false'` → `false` | Does **not** cancel ✓ |
|
||||
| `true` | `'true' != 'false'` → `true` | Cancels in-progress runs ✓ |
|
||||
@@ -9,7 +9,7 @@ compose:
|
||||
version: "2.0.1"
|
||||
typesense:
|
||||
image: "typesense/typesense"
|
||||
version: "30.1"
|
||||
version: "30.2"
|
||||
logout:
|
||||
enabled: true
|
||||
shared: true
|
||||
|
||||
@@ -21,15 +21,15 @@ build_and_install_arch() {
|
||||
local builder="pkgbuild"
|
||||
local pkg_path=""
|
||||
|
||||
echo "[arch] Initializing pacman keyring..."
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux
|
||||
# Tolerate missing manjaro keyring on pure Arch images (no manjaro.gpg present).
|
||||
pacman-key --populate manjaro 2>/dev/null || true
|
||||
|
||||
echo "[arch] Installing build toolchain..."
|
||||
pacman -Syu --noconfirm --needed base-devel sudo rsync
|
||||
|
||||
if ! pacman-key --list-sigs >/dev/null 2>&1; then
|
||||
echo "[arch] Initializing pacman keyring..."
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux
|
||||
fi
|
||||
|
||||
if ! id "${builder}" >/dev/null 2>&1; then
|
||||
echo "[arch] Creating build user '${builder}'..."
|
||||
useradd -m -s /bin/bash "${builder}"
|
||||
|
||||
@@ -28,7 +28,7 @@ documentation)
|
||||
expected_prefixes=(documentation)
|
||||
;;
|
||||
full)
|
||||
expected_prefixes=(feature fix dependabot alert-autofix)
|
||||
expected_prefixes=(feature fix chore dependabot alert-autofix)
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported PR_SCOPE '${PR_SCOPE}'." >&2
|
||||
|
||||
@@ -4,6 +4,17 @@ set -euo pipefail
|
||||
: "${GITHUB_EVENT_CREATED:?Missing GITHUB_EVENT_CREATED}"
|
||||
: "${GITHUB_OUTPUT:?Missing GITHUB_OUTPUT}"
|
||||
: "${GITHUB_SHA:?Missing GITHUB_SHA}"
|
||||
: "${GITHUB_REF:?Missing GITHUB_REF}"
|
||||
|
||||
if [[ "${GITHUB_REF}" == "refs/heads/main" && "${CI_RUN_ON_MAIN:-}" != "true" ]]; then
|
||||
{
|
||||
echo "should_run=false"
|
||||
echo "skip_reason=main-push-gated-by-ci-run-on-main"
|
||||
echo "commit_in_main=true"
|
||||
} >>"${GITHUB_OUTPUT}"
|
||||
echo "Push to main detected and repository variable CI_RUN_ON_MAIN is not 'true' -> CI will be skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${GITHUB_EVENT_CREATED}" != "true" ]]; then
|
||||
{
|
||||
|
||||
@@ -48,6 +48,13 @@ class TestPullRequestBranchPrefix(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("Validated branch prefix 'fix'", result.stdout)
|
||||
|
||||
def test_full_scope_accepts_chore_prefix(self):
|
||||
result = self._run_script(
|
||||
scope="full", head_ref="chore/update-docker-image-versions"
|
||||
)
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("Validated branch prefix 'chore'", result.stdout)
|
||||
|
||||
def test_mismatched_prefix_fails(self):
|
||||
result = self._run_script(scope="documentation", head_ref="feature/add-docs")
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
|
||||
Reference in new issue
Block a user