75 lines
2.7 KiB
YAML
75 lines
2.7 KiB
YAML
name: main-release-gate
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
verify-and-release:
|
|
runs-on: alkane-ci
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install Rust quality tools
|
|
run: rustup component add rustfmt clippy
|
|
- name: Formatting
|
|
run: cargo fmt --check
|
|
- name: Quality
|
|
run: cargo clippy --all-targets --locked -- -D warnings
|
|
- 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 | 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: 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
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: alkane-os-metrics
|
|
path: |
|
|
badges/metrics.json
|
|
coverage/tests.json
|
|
coverage/bench.json
|
|
bench-current.txt
|
|
- 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
|