added workflows #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test | |
on: | |
pull_request: | |
branches: | |
- "trunk" | |
push: | |
branches: | |
- "trunk" | |
permissions: | |
contents: write | |
env: | |
CARGO_TERM_COLOR: always | |
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }} | |
jobs: | |
cargo-deny: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: EmbarkStudios/cargo-deny-action@v2 | |
format: | |
name: Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Check Formatting | |
run: cargo fmt --all --check | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: Swatinem/rust-cache@v2.7.5 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build and Test | |
run: cargo test --all-features | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2.7.5 | |
# Disable cache for release builds | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
- uses: extractions/setup-just@v2 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
run: cargo build --all-features |