name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test --all
coverage:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false
release:
needs: [ci, coverage]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-24.04-arm
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Create GitHub Release
run: gh release create "${GITHUB_REF_NAME}" --verify-tag --generate-notes
env:
GH_TOKEN: ${{ github.token }}
release-binaries:
needs: [release]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-musl
os: ubuntu-24.04-arm
- target: x86_64-unknown-linux-musl
os: ubuntu-24.04
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: ev
target: ${{ matrix.target }}
archive: ev-$tag-$target
token: ${{ github.token }}