Skip to content

Commit

Permalink
Update CI; Test MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Dec 27, 2023
1 parent 7176d1b commit 9325f76
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 104 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ jobs:
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
toolchain: stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
uses: taiki-e/install-action@e8c64729e2a2a2c3cfa6751fa496b34ca19f390c # cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --workspace --codecov --output-path codecov.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
files: codecov.json
fail_ci_if_error: true
118 changes: 23 additions & 95 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,127 +3,55 @@ on: [push, pull_request]
name: CI

jobs:
check:
name: Build
build:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
# msrv
- 1.56.0
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --all

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all
toolchain: ${{ matrix.toolchain }}

# TODO: Enable Miri
# test_miri:
# name: Miri Test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# override: true
# components: miri
# - run: cargo miri test
#
# test_miri_big_endian:
# name: Miri Test Big Endian
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# override: true
# components: miri
# target: armebv7r-none-eabi
# - run: cargo miri test --target armebv7r-none-eabi

examples:
name: Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# build
- run: cargo build --all
# test
- run: cargo test --all
# run examples
- run: cargo run --example 2>&1 | grep -P ' ' | awk '{print $1}' | xargs -i cargo run --example {}

fmt:
name: Rustfmt
fmt-clippy-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- run: cargo clippy -- -D warnings
- run: cargo fmt --all -- --check

ensure_no_std:
name: Ensure no_std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
toolchain: nightly
override: true
target: thumbv7em-none-eabihf
- run: cd ensure_no_std && cargo build --release --target thumbv7em-none-eabihf

ensure_wasm:
name: Ensure wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
toolchain: nightly
override: true
- uses: jetli/[email protected]
with:
version: 'latest'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ jobs:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master
with:
profile: minimal
toolchain: stable
override: true
- uses: boa-dev/criterion-compare-action@v3
with:
branchName: ${{ github.base_ref }}
Expand Down

0 comments on commit 9325f76

Please sign in to comment.