Skip to content

Commit

Permalink
chore: refactor CI runs (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin271 committed Jan 21, 2024
1 parent 5c4827e commit de8fe05
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C debuginfo=0"
RUSTFLAGS: '-C debuginfo=0'

jobs:
build:
test:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
Expand All @@ -16,35 +16,55 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install toolchain
run: |
rustup update --no-self-update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
rustup component add clippy rustfmt
- name: Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-2"
prefix-key: 'v0-rust-2'

- name: Run test suite
run: cargo test --workspace

# TODO: In the future clippy and rustfmt dont need to be run on all the
# `os`', but it should be fast enough to be fine still for now
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: |
rustup update --no-self-update stable
rustup default stable
rustup component add clippy rustfmt
- name: Check spelling
uses: crate-ci/typos@master
- name: Formatting
run: cargo fmt --check

- name: Cache
uses: Swatinem/rust-cache@v2

- name: Linting
run: cargo clippy -- --deny warnings
- name: Run test suite
run: cargo test --workspace
run: cargo clippy --workspace -- --deny warnings

check-macos-arm:
runs-on: macos-11
build-macos-arm:
runs-on: macos-latest
strategy:
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install target
run: rustup update && rustup target add aarch64-apple-darwin
run: |
rustup update --no-self-update ${{ matrix.toolchain }}
rustup default ${{ matrix.toolchain }}
rustup target add aarch64-apple-darwin
- name: Cache
uses: Swatinem/rust-cache@v2
Expand Down

0 comments on commit de8fe05

Please sign in to comment.