Cover all Toolkit crates and pin CI image
This commit is contained in:
@@ -8,6 +8,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: alkane-fast
|
runs-on: alkane-fast
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
candidate:
|
candidate:
|
||||||
runs-on: alkane-ci
|
runs-on: alkane-ci
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
||||||
@@ -22,6 +24,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: Install build dependencies
|
- name: Install build dependencies
|
||||||
run: bash ci/ensure-build-deps.sh base
|
run: bash ci/ensure-build-deps.sh base
|
||||||
- name: Compute wxWidgets cache key
|
- name: Compute wxWidgets cache key
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: alkane-ci
|
runs-on: alkane-ci
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
||||||
@@ -29,6 +31,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check runner image pins
|
||||||
|
run: python3 ci/check-runner-image.py
|
||||||
|
|
||||||
- name: Compute version
|
- name: Compute version
|
||||||
id: ver
|
id: ver
|
||||||
run: bash ci/compute-version.sh | tee -a "$GITHUB_OUTPUT"
|
run: bash ci/compute-version.sh | tee -a "$GITHUB_OUTPUT"
|
||||||
@@ -82,7 +87,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rustup component add clippy >/dev/null 2>&1 || true
|
rustup component add clippy >/dev/null 2>&1 || true
|
||||||
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
||||||
cargo clippy -p alkane-artifacts -p alkane-flash -p alkane-cli --all-targets --offline -- -D warnings
|
cargo clippy --workspace --exclude alkane-gui --exclude wx-rs --all-targets --offline -- -D warnings
|
||||||
|
|
||||||
- name: Set crate version to ${{ steps.ver.outputs.version }}
|
- name: Set crate version to ${{ steps.ver.outputs.version }}
|
||||||
if: steps.ver.outputs.release == 'true'
|
if: steps.ver.outputs.release == 'true'
|
||||||
@@ -98,7 +103,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
cargo test -p alkane-gui --offline 2>&1 | tee tests-gui.txt
|
cargo test -p alkane-gui --offline 2>&1 | tee tests-gui.txt
|
||||||
cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline 2>&1 | tee tests-core.txt
|
cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline 2>&1 | tee tests-core.txt
|
||||||
cat tests-gui.txt tests-core.txt > tests-current.txt
|
cat tests-gui.txt tests-core.txt > tests-current.txt
|
||||||
|
|
||||||
- name: Load previous main benchmark measurement
|
- name: Load previous main benchmark measurement
|
||||||
|
|||||||
@@ -13,12 +13,16 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: alkane-fast
|
runs-on: alkane-fast
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||||
env:
|
env:
|
||||||
CARGO_BUILD_JOBS: 2
|
CARGO_BUILD_JOBS: 2
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check runner image pins
|
||||||
|
run: python3 ci/check-runner-image.py
|
||||||
- name: Source checks
|
- name: Source checks
|
||||||
run: cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline
|
run: cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline
|
||||||
- name: Clean generated Toolkit build
|
- name: Clean generated Toolkit build
|
||||||
if: always()
|
if: always()
|
||||||
run: python3 ci/cleanup-generated.py
|
run: python3 ci/cleanup-generated.py
|
||||||
|
|||||||
@@ -5,9 +5,15 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: alkane-toolkit-verify-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify:
|
verify:
|
||||||
runs-on: alkane-verify
|
runs-on: alkane-verify
|
||||||
|
container:
|
||||||
|
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:43bd4048ac01dff914ffb02ce5f2a07be37b5b0512ada66423247aebc74f0732
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_DIR: target
|
CARGO_TARGET_DIR: target
|
||||||
CARGO_BUILD_JOBS: 2
|
CARGO_BUILD_JOBS: 2
|
||||||
@@ -19,6 +25,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check runner image pins
|
||||||
|
run: python3 ci/check-runner-image.py
|
||||||
|
|
||||||
- name: Detect changed surface
|
- name: Detect changed surface
|
||||||
id: surface
|
id: surface
|
||||||
run: python3 ci/pr-surface.py >> "$GITHUB_OUTPUT"
|
run: python3 ci/pr-surface.py >> "$GITHUB_OUTPUT"
|
||||||
@@ -81,7 +90,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rustup component add clippy >/dev/null 2>&1 || true
|
rustup component add clippy >/dev/null 2>&1 || true
|
||||||
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
||||||
cargo clippy -p alkane-artifacts -p alkane-flash -p alkane-cli --all-targets --offline -- -D warnings
|
cargo clippy --workspace --exclude alkane-gui --exclude wx-rs --all-targets --offline -- -D warnings
|
||||||
|
|
||||||
- name: Headless crate checks
|
- name: Headless crate checks
|
||||||
if: steps.surface.outputs.surface == 'headless'
|
if: steps.surface.outputs.surface == 'headless'
|
||||||
@@ -108,7 +117,7 @@ jobs:
|
|||||||
if: steps.surface.outputs.surface == 'full'
|
if: steps.surface.outputs.surface == 'full'
|
||||||
run: |
|
run: |
|
||||||
cargo test -p alkane-gui --offline
|
cargo test -p alkane-gui --offline
|
||||||
cargo test -p alkane-artifacts -p alkane-flash -p alkane-cli --offline
|
cargo test --workspace --exclude alkane-gui --exclude wx-rs --offline
|
||||||
|
|
||||||
- name: Microbenchmarks
|
- name: Microbenchmarks
|
||||||
if: steps.surface.outputs.surface == 'full'
|
if: steps.surface.outputs.surface == 'full'
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
"""Keep Toolkit CI 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", "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("Toolkit 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