Some checks failed
CI / ci (pull_request) Failing after 26s
Cache ~/.rustup so the toolchain isn't reinstalled every run, and install cargo-make/cargo-audit via cargo-binstall instead of compiling them from source each time.
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Cache cargo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/bin
|
|
~/.rustup
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Install Rust toolchain
|
|
run: |
|
|
if [ ! -x "$HOME/.cargo/bin/rustc" ]; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal --component clippy --component rustfmt
|
|
fi
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install cargo-binstall
|
|
run: |
|
|
command -v cargo-binstall >/dev/null 2>&1 || \
|
|
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
|
|
|
- name: Install cargo-make and cargo-audit
|
|
run: |
|
|
for crate in cargo-make cargo-audit; do
|
|
command -v "$crate" >/dev/null 2>&1 || cargo binstall -y "$crate"
|
|
done
|
|
|
|
- name: Run CI checks
|
|
run: cargo make ci
|