Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c424f7e192 | ||
|
|
ae7745772a | ||
|
|
28af64daa5 | ||
|
|
871a2cd3f7 | ||
|
|
322766cf63 | ||
|
|
c13db2a5ba | ||
|
|
777322c66b | ||
|
|
629dff22fe | ||
|
|
1d000e037b |
@@ -12,7 +12,9 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: alkane-pages
|
runs-on: alkane-verify
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: alkane-fast
|
runs-on: alkane-verify
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
source:
|
source:
|
||||||
runs-on: alkane-fast
|
runs-on: alkane-fast
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
CARGO_BUILD_JOBS: 2
|
CARGO_BUILD_JOBS: 2
|
||||||
@@ -19,6 +21,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Check runner image pins
|
||||||
|
run: python3 ci/check-runner-image.py
|
||||||
- name: Detect README-only change
|
- name: Detect README-only change
|
||||||
id: surface
|
id: surface
|
||||||
run: |
|
run: |
|
||||||
@@ -26,7 +30,7 @@ jobs:
|
|||||||
if [ "$GITHUB_EVENT_NAME" = pull_request ] &&
|
if [ "$GITHUB_EVENT_NAME" = pull_request ] &&
|
||||||
{ [ "$GITHUB_BASE_REF" = main ] || [ "$GITHUB_BASE_REF" = next ]; } &&
|
{ [ "$GITHUB_BASE_REF" = main ] || [ "$GITHUB_BASE_REF" = next ]; } &&
|
||||||
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF" 2>/dev/null)" &&
|
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF" 2>/dev/null)" &&
|
||||||
changed="$(git diff --name-only "$base" HEAD)" &&
|
changed="$(git diff --no-renames --name-only "$base" HEAD)" &&
|
||||||
[ "$changed" = README.md ]; then
|
[ "$changed" = README.md ]; then
|
||||||
surface=documentation
|
surface=documentation
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
verify-and-release:
|
verify-and-release:
|
||||||
runs-on: alkane-ci
|
runs-on: alkane-ci
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
permissions:
|
permissions:
|
||||||
@@ -56,17 +58,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
||||||
- name: Restore coverage tool
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /root/.cargo/bin/cargo-llvm-cov
|
|
||||||
key: cargo-llvm-cov-0.8.7-rust-1.97.1-${{ runner.os }}
|
|
||||||
- name: Coverage tool
|
- name: Coverage tool
|
||||||
run: |
|
run: |
|
||||||
rustup component add llvm-tools-preview
|
rustup component add llvm-tools-preview
|
||||||
if [ "$(cargo llvm-cov --version 2>/dev/null || true)" != 'cargo-llvm-cov 0.8.7' ]; then
|
|
||||||
cargo install --locked --force cargo-llvm-cov --version 0.8.7
|
|
||||||
fi
|
|
||||||
[ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ]
|
[ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ]
|
||||||
- name: Unit test coverage
|
- name: Unit test coverage
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: alkane-fast
|
runs-on: alkane-verify
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
CARGO_BUILD_JOBS: 2
|
CARGO_BUILD_JOBS: 2
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
"""Keep OS jobs on the verified Alkane runner image."""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
IMAGE = (ROOT / "ci/runner-image.txt").read_text().strip()
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
if not re.fullmatch(
|
||||||
|
r"gitea\.bluefla\.re/blueflare/alkane-ci@sha256:[0-9a-f]{64}", IMAGE
|
||||||
|
):
|
||||||
|
print("Runner image must be pinned by Gitea registry digest", file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
for path in sorted((ROOT / ".gitea/workflows").glob("*.yml")):
|
||||||
|
workflow = yaml.load(path.read_text(), Loader=yaml.BaseLoader)
|
||||||
|
for name, job in workflow.get("jobs", {}).items():
|
||||||
|
if (job.get("runs-on") in {"alkane-fast", "alkane-pages"}
|
||||||
|
and "secrets." in str(job)):
|
||||||
|
print(f"{path.name}: {name} exposes a secret to the fast runner", file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
if job.get("runs-on") not in {"alkane-ci", "alkane-fast", "alkane-verify"}:
|
||||||
|
continue
|
||||||
|
if job.get("container", {}).get("image") != IMAGE:
|
||||||
|
print(f"{path.name}: {name} has a different runner image", file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
print("OS runner image pins: PASS")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
gitea.bluefla.re/blueflare/alkane-ci@sha256:ad56db2fc456a3f1c68c715ba44309751cb5c455376d9f797ac346833c011e15
|
||||||
Reference in New Issue
Block a user