Startup code #18
This file contains hidden or 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: PR Check | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cache cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build project | |
run: cargo build --release | |
- name: Install Rust deps | |
run: rustup install nightly-2025-05-14 && rustup component add rust-src --toolchain nightly-2025-05-14 | |
- name: Run tests | |
run: cargo test --release | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust deps | |
run: rustup install nightly-2025-05-14 && rustup component add clippy --toolchain nightly-2025-05-14 | |
- name: Run Clippy | |
run: cargo clippy --all-targets -- -D warnings | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
run: cargo fmt --all -- --check |