Skip to content

feat(ci): Update self-action #4

feat(ci): Update self-action

feat(ci): Update self-action #4

Workflow file for this run

name: "Build"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.rust-version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
rust-version: [ stable, beta, nightly ]
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup - Rust Toolchain"
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
if: steps.changes.outputs.src == 'true'
with:
components: clippy,rustfmt
toolchain: ${{ matrix.rust-version }}
- name: "Restore cached Cargo"
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.rust-version }}-cargo
- name: "Formatting Check"
run: cargo fmt --check
- name: "Run build..."
run: |
set -e
cargo build --workspace
cargo test --workspace
- name: Save Cargo / Rust Cache
id: cache-save
if: ${{ github.event_name == 'push' }}
uses: actions/cache/save@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ steps.cache-restore.outputs.cache-primary-key }}