Skip to content

fix: apply rustfmt formatting #6

fix: apply rustfmt formatting

fix: apply rustfmt formatting #6

Workflow file for this run

name: build-and-test
description: Use when building or testing the OTPBar application in CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
name: Build and Test
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/
~/.cargo/git/db
src-tauri/target
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: |
node_modules
.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install frontend dependencies
run: npm ci
- name: Run frontend lint
run: npm run lint || true
- name: Run frontend build
run: npm run build
- name: Run Rust tests
working-directory: src-tauri
run: cargo test --all-features
- name: Run Rust clippy
working-directory: src-tauri
run: cargo clippy -- -D warnings
- name: Check Rust formatting
working-directory: src-tauri
run: cargo fmt -- --check
- name: Build Tauri app
run: npm run tauri build