name: Rust on: push: branches: [ "main" ] pull_request: branches: [ "main" ] schedule: - cron: '0 9 * * 1' env: CARGO_TERM_COLOR: always jobs: build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-24.04, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Set up cargo cache uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-debug- - name: Build run: cargo build --verbose unit-test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-24.04, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Set up cargo cache uses: actions/cache@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-debug- - name: Run clippy run: cargo clippy -- -D warnings - name: Run tests run: cargo test --verbose fmt: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Run cargo fmt run: cargo fmt --all -- --check