Modernize CI to use current, non-archived actions #48
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ staging, trying, master ] | |
pull_request: | |
name: Build | |
env: | |
RUSTFLAGS: '--deny warnings' | |
MSRV: 1.76 | |
jobs: | |
build-std: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
FEATURES: ['', 'from_str', 'std', 'serde', 'regex'] | |
TARGET: ['x86_64-unknown-linux-gnu'] | |
include: | |
# Test nightly but don't fail | |
- rust: nightly | |
experimental: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
target: ${{ matrix.TARGET }} | |
- name: Build std | |
run: cargo build --target=${{ matrix.TARGET }} --features=${{ matrix.FEATURES }} | |
- name: Test std | |
run: cargo test --target=${{ matrix.TARGET }} --features=${{ matrix.FEATURES }} | |
build-no-std: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
TARGET: [thumbv6m-none-eabi, thumbv7m-none-eabi] | |
include: | |
# Test nightly but don't fail | |
- rust: nightly | |
experimental: true | |
TARGET: x86_64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
target: ${{ matrix.TARGET }} | |
- name: Build std | |
run: cargo build --target=${{ matrix.TARGET }} --features=${{ matrix.FEATURES }} | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
target: ${{ matrix.TARGET }} | |
components: rustfmt | |
- name: Format | |
run: cargo fmt --all -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
FEATURES: ['', 'from_str', 'std', 'serde', 'regex'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
target: ${{ matrix.TARGET }} | |
components: clippy | |
- name: Clippy | |
run: cargo clippy --features=${{ matrix.FEATURES }} -- -D warnings |