Skip to content

Initial commit

Initial commit #10

Workflow file for this run

name: Check, test, clippy
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- run: rustup update
- uses: ./.github/actions/rust-cache
with:
cache-name: check
- run: cargo check --all-targets
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- run: rustup update
- uses: ./.github/actions/rust-cache
with:
cache-name: test
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-nextest
run: cargo binstall --no-confirm cargo-nextest
- run: cargo nextest run --profile ci --cargo-profile ci
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update
- uses: ./.github/actions/rust-cache
with:
cache-name: clippy
- run: cargo clippy --all-targets -- -D warnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install nightly
- run: cargo +nightly fmt --check
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-deny
run: cargo binstall --no-confirm cargo-deny
- run: cargo deny check
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-audit
run: cargo binstall --no-confirm cargo-audit
- run: cargo audit
# cross-build:
# runs-on: ${{ matrix.target.runner }}
# strategy:
# matrix:
# target:
# - { arch: x86_64-linux, runner: ubuntu-latest }
# - { arch: aarch64-linux, runner: ubuntu-latest }
# - { arch: aarch64-darwin, runner: macos-latest }
# - { arch: x86_64-darwin, runner: macos-latest }
# steps:
# - uses: actions/checkout@v4
# - name: Install nix
# uses: nixbuild/nix-quick-install-action@v32
# - uses: ./.github/actions/rust-cache
# with:
# cache-name: cross-build
# - name: Determine rust target
# id: rust-target
# run: |
# case "${{ matrix.target.arch }}" in
# "x86_64-linux")
# echo "rust_target=x86_64-unknown-linux-musl" >> $GITHUB_OUTPUT
# ;;
# "aarch64-linux")
# echo "rust_target=aarch64-unknown-linux-musl" >> $GITHUB_OUTPUT
# ;;
# "x86_64-darwin")
# echo "rust_target=x86_64-apple-darwin" >> $GITHUB_OUTPUT
# ;;
# "aarch64-darwin")
# echo "rust_target=aarch64-apple-darwin" >> $GITHUB_OUTPUT
# ;;
# esac
# - name: Build binary
# run: |
# nix develop .#crossBuildShell-${{ matrix.target.arch }} -c \
# cargo build --locked --release