Files
hayabusa/.github/workflows/rust.yml
2022-09-22 15:54:21 +09:00

54 lines
1.7 KiB
YAML

name: Rust
on:
pull_request:
branches:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
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: m1 mac Build
# run: cross build --verbose --target aarch64-apple-darwin
# - name: Intel mac Build
# run: cross build --verbose --target x86_64-apple-darwin
- name: Setup build lib
run: sudo apt install musl-gcc && mingw-w64
- name: x86-64-windows(msvc) Build
run: cross build --verbose --target x86_64-pc-windows-msvc
- name: i686-windows(msvc) Build
run: cross build --verbose --target i686-pc-windows-msvc
- name: Linux musl Build
run: cross build --verbose --target x86_64-unknown-linux-musl
- name: Run tests
run: RUST_TEST_THREADS=1 cargo test --verbose