Skip to content

feat: add CI workflow for building and testing Rust project #1

feat: add CI workflow for building and testing Rust project

feat: add CI workflow for building and testing Rust project #1

Workflow file for this run

name: F4a services CI
on:
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cargo Check
run: cargo check --all-targets --locked
- name: Cargo Build
run: cargo build --verbose
- name: Cargo tests
run: cargo test --verbose
- name: Cargo Clippy
run: cargo clippy -- -D warnings
- name: Cargo fmt
run: cargo fmt --all --check