127 lines
4.8 KiB
YAML
127 lines
4.8 KiB
YAML
name: main-release-gate
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: alkane-os-main
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
verify-and-release:
|
|
runs-on: alkane-ci
|
|
env:
|
|
CARGO_TARGET_DIR: target
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Pages SSH client
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y -qq --no-install-recommends openssh-client
|
|
- name: Install Rust quality tools
|
|
run: rustup component add rustfmt clippy
|
|
- name: Formatting
|
|
run: cargo fmt --check
|
|
- name: Last-attempt badge checks
|
|
run: python3 ci/test-last-attempt-badge.py
|
|
- name: Benchmark history checks
|
|
run: python3 ci/test-bench-history.py
|
|
- name: Metric badge checks
|
|
run: python3 ci/test-metrics.py
|
|
- name: Release evidence gate checks
|
|
run: python3 ci/test-conformance.py
|
|
- name: Release publication checks
|
|
run: python3 ci/test-release.py
|
|
- name: CI cleanup containment checks
|
|
run: python3 ci/test-cleanup-generated.py
|
|
- name: Quality
|
|
run: |
|
|
cargo clippy --all-targets --locked -- -D warnings
|
|
printf '{"format":true,"clippy_warnings_denied":true}\n' > quality-current.json
|
|
- name: Build
|
|
run: cargo build --release --locked
|
|
- name: Unit and workflow tests
|
|
run: |
|
|
set -o pipefail
|
|
cargo test --locked 2>&1 | tee tests-current.txt
|
|
- name: Microbenchmarks
|
|
run: |
|
|
set -o pipefail
|
|
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
|
- name: Coverage tool
|
|
run: |
|
|
rustup component add llvm-tools-preview
|
|
if ! command -v cargo-llvm-cov >/dev/null 2>&1; then
|
|
cargo install --locked cargo-llvm-cov --version 0.8.7
|
|
fi
|
|
- name: Unit test coverage
|
|
run: |
|
|
mkdir -p coverage
|
|
CARGO_TARGET_DIR=target/coverage-tests cargo llvm-cov --json \
|
|
--output-path coverage/tests.json --locked
|
|
- name: Microbenchmark coverage
|
|
run: |
|
|
CARGO_TARGET_DIR=target/coverage-bench cargo llvm-cov --json \
|
|
--output-path coverage/bench.json --locked -- --ignored
|
|
- name: Load previous main benchmark measurement
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/bench_history.py prepare
|
|
- name: Generate measured badges
|
|
run: |
|
|
python3 ci/metrics.py --tests-output tests-current.txt \
|
|
--tests-coverage coverage/tests.json --bench-output bench-current.txt \
|
|
--bench-coverage coverage/bench.json --quality-gate quality-current.json
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
|
|
with:
|
|
name: alkane-os-metrics
|
|
path: |
|
|
badges/metrics.json
|
|
quality-current.json
|
|
coverage/tests.json
|
|
coverage/bench.json
|
|
bench-current.txt
|
|
- name: Publish measured badges privately
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/publish-metrics.py
|
|
- name: Record private benchmark history
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 ci/bench_history.py publish
|
|
- uses: https://github.com/ChristopherHX/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7
|
|
with:
|
|
name: alkane-os-benchmark-site-preview
|
|
path: bench-site/index.html
|
|
- name: Publish public benchmark page
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
BENCH_PAGES_DEPLOY_KEY: ${{ secrets.BENCH_PAGES_DEPLOY_KEY }}
|
|
run: python3 ci/publish-bench-pages.py os
|
|
- name: Pairing and simulator conformance
|
|
run: python3 ci/check-conformance.py
|
|
- name: Select release version
|
|
id: version
|
|
run: python3 ci/version.py main >> "$GITHUB_OUTPUT"
|
|
- name: Package source and benchmark result
|
|
if: steps.version.outputs.release == 'true'
|
|
run: |
|
|
mkdir -p dist
|
|
git archive --format=tar.gz --output="dist/alkane-os-${{ steps.version.outputs.version }}-source.tar.gz" HEAD
|
|
cp target/release/alkane-os dist/
|
|
cp bench-current.txt dist/
|
|
- name: Create private release
|
|
if: steps.version.outputs.release == 'true'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: python3 ci/release.py "${{ steps.version.outputs.tag }}" false "dist/alkane-os-${{ steps.version.outputs.version }}-source.tar.gz" dist/alkane-os dist/bench-current.txt
|
|
- name: Clean generated build and benchmark work
|
|
if: always()
|
|
run: python3 ci/cleanup-generated.py
|