Add Cargo.lock #23
Workflow file for this run
This file contains 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: Rust | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- .github/workflows/rust.yml | |
- Cargo.* | |
- crates/** | |
- rust-toolchain | |
- rustfmt.toml | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: ./.github/actions/rust-toolchain-from-file | |
with: | |
components: rustfmt | |
- name: Rustfmt | |
run: cargo fmt --all -- --check | |
clippy: | |
strategy: | |
fail-fast: false | |
matrix: | |
target-triple: | |
- x86_64-pc-windows-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-unknown-linux-gnu | |
include: | |
- { target-triple: x86_64-pc-windows-gnu, os: windows-2022 } | |
- { target-triple: x86_64-pc-windows-msvc, os: windows-2022 } | |
- { target-triple: x86_64-unknown-linux-gnu, os: ubuntu-22.04 } | |
name: Clippy (${{ matrix.target-triple }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: ./.github/actions/rust-toolchain-from-file | |
with: | |
targets: ${{ matrix.target-triple }} | |
components: clippy | |
- name: cargo-generate-lockfile | |
run: cargo generate-lockfile | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: cargo-clippy | |
run: cargo clippy --all-targets --target ${{ matrix.target-triple }} -- -D warnings | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
target-triple: | |
- x86_64-pc-windows-gnu | |
- x86_64-pc-windows-msvc | |
- x86_64-unknown-linux-gnu | |
include: | |
- { target-triple: x86_64-pc-windows-gnu, os: windows-2022 } | |
- { target-triple: x86_64-pc-windows-msvc, os: windows-2022 } | |
- { target-triple: x86_64-unknown-linux-gnu, os: ubuntu-22.04 } | |
name: Test (${{ matrix.target-triple }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: ./.github/actions/rust-toolchain-from-file | |
with: | |
targets: ${{ matrix.target-triple }} | |
- name: cargo-generate-lockfile | |
run: cargo generate-lockfile | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: cargo-test | |
run: cargo test --target ${{ matrix.target-triple }} | |
env: | |
RUST_BACKTRACE: full |