Skip to content

Commit

Permalink
Add CI jobs to run tests, and check no_std no_alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed Feb 1, 2024
1 parent a47a33d commit 2c451f0
Showing 1 changed file with 55 additions and 30 deletions.
85 changes: 55 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: [push, pull_request]
on: [pull_request]

name: Rust CI

Expand All @@ -7,37 +7,55 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Load rust cache
uses: astriaorg/buildjet-rust-cache@v2.5.1
- name: Run cargo check, failing on warnings
run: cargo check --profile ci --all-targets
# It'd be nice to fail on warnings, but we're not ready for that.
# env:
# RUSTFLAGS: "-D warnings"

test:
name: Test Suite
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Load rust cache
uses: astriaorg/buildjet-rust-cache@v2.5.1
- name: Run tests with nextest
run: cargo nextest run --cargo-profile ci --profile ci
env:
CARGO_TERM_COLOR: always

build_no_alloc:
name: build without alloc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup target add thumbv7em-none-eabihf
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
command: build
args: --target thumbv7em-none-eabihf --no-default-features

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -50,19 +68,26 @@ jobs:
command: fmt
args: --all -- --check

# clippy:
# name: Clippy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - uses: Swatinem/rust-cache@v1
# - run: rustup component add clippy
# - uses: actions-rs/cargo@v1
# with:
# command: clippy
# args: -- -D warnings
no-std:
name: no_std compatibility check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features

0 comments on commit 2c451f0

Please sign in to comment.