Skip to content

enable overflow checks #2648

enable overflow checks

enable overflow checks #2648

Workflow file for this run

name: Rust
on:
pull_request:
branches:
- "*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
info:
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-gnu",
cross: false,
}
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-musl",
cross: true,
}
# - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false }
# - { os: "macOS-latest", target: "aarch64-apple-darwin", cross: false }
- {
os: "windows-latest",
target: "x86_64-pc-windows-msvc",
cross: false,
}
- {
os: "windows-latest",
target: "i686-pc-windows-msvc",
cross: true,
}
runs-on: ${{ matrix.info.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Rust toolchain
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
targets: ${{ matrix.info.target }}
- name: Enable Rust cache
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f #2.1.0
- name: Fmt Check
run: cargo fmt -- --check
- name: Prepare Clippy
run: rustup component add clippy
- name: Run clippy action to produce annotations
run: cargo clippy --all-targets -- -D warnings
- name: Build tests
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: test
args: --no-run --locked ${{ matrix.features }} --target=${{ matrix.info.target }}
use-cross: ${{ matrix.info.cross }}
cross-version: 0.2.4
env:
RUST_BACKTRACE: full
- name: Run tests
env:
RUST_TEST_THREADS: 1
run: cargo test --verbose