Files
hayabusa/.github/workflows/rust.yml
2022-09-22 19:36:01 +09:00

46 lines
1.3 KiB
YAML

name: Rust
on:
pull_request:
branches:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
fail-fast: false
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
override: true
- name: Fmt Check
run: cargo fmt -- --check
- name: Prepare Clippy
run: rustup component add clippy
- name: Run clippy action to produce annotations
uses: actions-rs/clippy-check@v1
with:
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Cross Compile Crate
run: cargo install cross
- name: Setup Cross Compile Environment
run: rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-msvc aarch64-apple-darwin x86_64-apple-darwin
- name: Linux gnu Build
run: cargo build --verbose
- name: Run tests
env:
RUST_TEST_THREADS: 1
run: cargo test --verbose