ref:main
image: rust:1.95-trixie
steps:
- name: check
run: cargo check --all-targets 2>&1
cache:
key: Cargo.lock
paths:
- target/
- /usr/local/cargo/registry/
- name: test
run: cargo test 2>&1
depends_on: [check]
cache:
key: Cargo.lock
paths:
- target/
- name: coverage
timeout_seconds: 1800
run: |
cargo install cargo-tarpaulin --version 0.32.7 2>&1
cargo tarpaulin --out lcov --output-dir coverage/ 2>&1
depends_on: [check]
cache:
key: Cargo.lock
paths:
- target/
artifacts:
- name: lcov.info
path: coverage/lcov.info
- name: clippy
run: |
rustup component add clippy
cargo clippy --all-targets -- -D warnings 2>&1
depends_on: [check]
cache:
key: Cargo.lock
paths:
- target/
- name: fmt
run: |
rustup component add rustfmt
cargo fmt -- --check 2>&1
- name: build
run: cargo build --release 2>&1
depends_on: [test, clippy, fmt]
cache:
key: Cargo.lock
paths:
- target/
artifacts:
- name: anvil-binary
path: target/release/anvil
- name: build-runner
timeout_seconds: 1800
# Delegated to a bash script because the runner invokes /bin/sh (dash)
# and we need bash features (pipefail, trap ERR) for publish rollback.
run: |
apt-get update && apt-get install -y bash curl gcc-x86-64-linux-gnu jq 2>&1
exec bash ci/build-runner.sh
depends_on: [test, clippy, fmt]
cache:
key: Cargo.lock
paths:
- target/
artifacts:
- name: anvil_linux_arm64
path: runner-dist/anvil_linux_arm64
- name: anvil_linux_amd64
path: runner-dist/anvil_linux_amd64