Merge pull request #2140 from squidowl/dependabot/cargo/main/rust-dep… #4909
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: Build | |
| on: | |
| pull_request: | |
| paths: | |
| - "**.rs" | |
| - "**/Cargo.toml" | |
| - "Cargo.lock" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**.rs" | |
| - "**/Cargo.toml" | |
| - "Cargo.lock" | |
| merge_group: | |
| paths: | |
| - "**.rs" | |
| - "**/Cargo.toml" | |
| - "Cargo.lock" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-check-clippy-test: | |
| name: Build, Check, Clippy, Test, & Format | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - target: macos | |
| os: macos-latest | |
| rustflags: "" | |
| - target: macos-intel | |
| os: macos-26-intel | |
| rustflags: "" | |
| - target: windows | |
| os: windows-latest | |
| rustflags: "" | |
| - target: linux | |
| os: ubuntu-latest | |
| rustflags: "-C linker=clang -C link-arg=-fuse-ld=mold" | |
| runs-on: ${{ matrix.target.os }} | |
| env: | |
| RUSTFLAGS: ${{ matrix.target.rustflags }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install dependencies | |
| if: matrix.target.target == 'linux' | |
| run: | | |
| sudo apt update | |
| sudo apt install $(cat .github/linux-deps.txt) git mold clang | |
| - uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target | |
| key: ${{ runner.os }}-${{ runner.arch }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-cargo-debug- | |
| - uses: dtolnay/rust-toolchain@master # recommended when specifying toolchain | |
| with: | |
| toolchain: stable minus 3 releases | |
| components: clippy | |
| - run: cargo version | |
| - name: Check | |
| run: cargo check --locked --profile ci | |
| - name: Clippy | |
| run: cargo clippy --locked --profile ci --workspace --all-targets -- -D warnings | |
| - uses: taiki-e/install-action@682e7d9e49c5e653d371fc6adbda67653461378a # v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Test | |
| run: cargo nextest run --locked --profile ci --workspace --all-targets | |
| - uses: dtolnay/rust-toolchain@master # recommended when specifying toolchain | |
| if: matrix.target.target == 'linux' | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: Format | |
| if: matrix.target.target == 'linux' | |
| run: cargo +nightly fmt --all -- --check --color=always |