Skip to content

migrate RUSTFLAGS into CI #38

migrate RUSTFLAGS into CI

migrate RUSTFLAGS into CI #38

Workflow file for this run

name: CI
on:
push:
paths: ['**.rs', '**.toml', '**/ci.yml']
pull_request:
paths: ['**.rs', '**.toml', '**/ci.yml']
env:
CARGO_TERM_COLOR: always
jobs:
ubuntu:
name: full check on ubuntu (${{ matrix.toolchain }} channel)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- name: switch to ${{ matrix.toolchain }} channel and download mold
run: |
rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
rustup component add rustfmt clippy
sudo apt-get update && sudo apt-get install mold
- name: build
run: RUSTFLAGS="-C target-cpu=native" mold -run cargo b -v --profile testing
- name: fmt and clippy check
if: ${{ matrix.toolchain == 'nightly' }}
run: |
cargo fmt -- --check
RUSTFLAGS="-C target-cpu=native" mold -run cargo clippy --profile testing -- -D warnings
- name: test
run: RUSTFLAGS="-C target-cpu=native" mold -run cargo t -v --profile testing
macos:
name: full check on macos (${{ matrix.toolchain }} channel)
runs-on: macos-14
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- name: switch to ${{ matrix.toolchain }} channel
run: |
rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
rustup component add rustfmt clippy
- name: build
run: RUSTFLAGS="-C target-cpu=native" cargo b -v --profile testing
- name: fmt and clippy check
if: ${{ matrix.toolchain == 'nightly' }}
run: |
cargo fmt -- --check
RUSTFLAGS="-C target-cpu=native" cargo clippy --profile testing -- -D warnings
- name: test
run: RUSTFLAGS="-C target-cpu=native" cargo t -v --profile testing
- name: very pedantic clippy
if: ${{ matrix.toolchain == 'nightly' }}
run: |
RUSTFLAGS="-Zmacro-backtrace -C target-cpu=native" \
rustup run nightly cargo clippy --profile testing --all -- \
-W clippy::all \
-W clippy::pedantic \
-W clippy::restriction \
-W clippy::nursery || true
continue-on-error: true
msys2:
name: full check on windows (msys2 - ${{ matrix.sys }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys: [CLANG64, UCRT64]
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.sys }}
pacboy: rust:p
- name: build
run: msys2 -c 'RUSTFLAGS="-C target-cpu=native" cargo b -v --profile testing'
- name: test
run: msys2 -c 'RUSTFLAGS="-C target-cpu=native" cargo t -v --profile testing'