name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'CHANGELOG*'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'CHANGELOG*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
jobs:
audit:
name: Security Audit
runs-on: [self-hosted, linux, arm64]
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Configure SSH for private repos
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 with:
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: audit
- name: Install cargo-audit
run: which cargo-audit >/dev/null 2>&1 || cargo install cargo-audit --locked
- name: Run cargo audit
run: cargo audit
check:
name: Check
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v6
- name: Configure SSH for private repos
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 with:
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: check
- run: cargo check
clippy:
name: Clippy
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v6
- name: Configure SSH for private repos
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 with:
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: clippy
- run: cargo clippy -- -D warnings
fmt:
name: Format
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
test:
name: Test
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v6
- name: Configure SSH for private repos
uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 with:
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: test
- run: cargo test