ci: use run-ci label for branch CI opt-in (nix + macos)

This commit is contained in:
Nicholas Dudfield
2026-02-17 15:25:28 +07:00
parent a6cc563ca1
commit 7bc0cbe2fd
2 changed files with 11 additions and 5 deletions

View File

@@ -4,7 +4,8 @@ on:
push:
branches: ["dev", "candidate", "release"]
pull_request:
branches: ["dev", "candidate", "release"]
branches: ["**"]
types: [opened, synchronize, reopened, labeled]
schedule:
- cron: '0 0 * * *'
@@ -14,6 +15,11 @@ concurrency:
jobs:
test:
if: >
github.event_name != 'pull_request' ||
contains(fromJson('["dev","candidate","release"]'), github.base_ref) ||
contains(join(github.event.pull_request.labels.*.name, ','), 'run-ci') ||
contains(join(github.event.pull_request.labels.*.name, ','), 'ci-nix-full-matrix')
strategy:
matrix:
generator:

View File

@@ -24,8 +24,8 @@ jobs:
if: >
github.event_name != 'pull_request' ||
contains(fromJson('["dev","candidate","release"]'), github.base_ref) ||
contains(join(github.event.pull_request.labels.*.name, ','), 'ci-nix-full-matrix') ||
contains(join(github.event.pull_request.labels.*.name, ','), 'ci-nix-min-matrix')
contains(join(github.event.pull_request.labels.*.name, ','), 'run-ci') ||
contains(join(github.event.pull_request.labels.*.name, ','), 'ci-nix-full-matrix')
runs-on: [self-hosted, generic, 20.04]
container: python:3-slim
outputs:
@@ -163,7 +163,7 @@ jobs:
or "ci-nix-full-matrix" in pr_labels
)
force_min = (
"ci-nix-min-matrix" in pr_labels
"run-ci" in pr_labels
)
print(f"Force full matrix: {force_full}")
print(f"Force min matrix: {force_min}")
@@ -177,7 +177,7 @@ jobs:
# Override: always use full matrix if forced by manual input or label.
use_full = True
elif force_min:
# Override: always use minimal matrix if ci-nix-min-matrix label is present.
# Override: always use minimal matrix if run-ci label is present.
use_full = False
elif event_name == "pull_request":
# For PRs, base_ref is just the branch name (e.g., "dev", not "refs/heads/dev")