Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
322766cf63 | ||
|
|
c13db2a5ba | ||
|
|
777322c66b | ||
|
|
629dff22fe | ||
|
|
1d000e037b |
@@ -13,6 +13,8 @@ concurrency:
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: alkane-fast
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||
permissions:
|
||||
actions: read
|
||||
contents: write
|
||||
|
||||
@@ -12,6 +12,8 @@ concurrency:
|
||||
jobs:
|
||||
source:
|
||||
runs-on: alkane-fast
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||
env:
|
||||
CARGO_TARGET_DIR: target
|
||||
CARGO_BUILD_JOBS: 2
|
||||
@@ -19,6 +21,8 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Check runner image pins
|
||||
run: python3 ci/check-runner-image.py
|
||||
- name: Detect README-only change
|
||||
id: surface
|
||||
run: |
|
||||
@@ -26,7 +30,7 @@ jobs:
|
||||
if [ "$GITHUB_EVENT_NAME" = pull_request ] &&
|
||||
{ [ "$GITHUB_BASE_REF" = main ] || [ "$GITHUB_BASE_REF" = next ]; } &&
|
||||
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
|
||||
surface=documentation
|
||||
fi
|
||||
|
||||
@@ -11,6 +11,8 @@ concurrency:
|
||||
jobs:
|
||||
verify-and-release:
|
||||
runs-on: alkane-ci
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||
env:
|
||||
CARGO_TARGET_DIR: target
|
||||
permissions:
|
||||
@@ -57,7 +59,9 @@ jobs:
|
||||
set -o pipefail
|
||||
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
||||
- name: Restore coverage tool
|
||||
uses: actions/cache@v4
|
||||
id: coverage-cache
|
||||
uses: actions/cache/restore@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: /root/.cargo/bin/cargo-llvm-cov
|
||||
key: cargo-llvm-cov-0.8.7-rust-1.97.1-${{ runner.os }}
|
||||
@@ -68,6 +72,13 @@ jobs:
|
||||
cargo install --locked --force cargo-llvm-cov --version 0.8.7
|
||||
fi
|
||||
[ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ]
|
||||
- name: Save coverage tool
|
||||
if: steps.coverage-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: /root/.cargo/bin/cargo-llvm-cov
|
||||
key: cargo-llvm-cov-0.8.7-rust-1.97.1-${{ runner.os }}
|
||||
- name: Unit test coverage
|
||||
run: |
|
||||
mkdir -p coverage
|
||||
|
||||
@@ -11,6 +11,8 @@ concurrency:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: alkane-fast
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||
env:
|
||||
CARGO_TARGET_DIR: target
|
||||
CARGO_BUILD_JOBS: 2
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/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") not in {"alkane-ci", "alkane-fast"}:
|
||||
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:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||
Reference in New Issue
Block a user