Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 28 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,36 @@ name: Build

env:
RUSTFLAGS: '--deny warnings'
MSRV: 1.76

jobs:
build-std:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
FEATURES: ['', 'from_str', 'std', 'serde']
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@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ env.MSRV }}
target: ${{ matrix.TARGET }}
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --target=x86_64-unknown-linux-gnu --features=${{ matrix.FEATURES }}
- uses: actions-rs/cargo@v1
with:
command: test
args: --target=x86_64-unknown-linux-gnu --features=${{ matrix.FEATURES }}
- 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:
rust: [stable]
TARGET: [thumbv6m-none-eabi, thumbv7m-none-eabi]

include:
Expand All @@ -52,47 +46,37 @@ jobs:
TARGET: x86_64-unknown-linux-gnu

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
toolchain: ${{ env.MSRV }}
target: ${{ matrix.TARGET }}
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ matrix.TARGET }}
- name: Build std
run: cargo build --target=${{ matrix.TARGET }} --features=${{ matrix.FEATURES }}

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
toolchain: ${{ env.MSRV }}
target: ${{ matrix.TARGET }}
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Format
run: cargo fmt --all -- --check

clippy:
runs-on: ubuntu-latest
strategy:
matrix:
FEATURES: ['', 'from_str', 'std']
FEATURES: ['', 'from_str', 'std', 'serde', 'regex']
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: 1.76 # clippy is too much of a moving target at the moment
override: true
toolchain: ${{ env.MSRV }}
target: ${{ matrix.TARGET }}
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features=${{ matrix.FEATURES }}
- name: Clippy
run: cargo clippy --features=${{ matrix.FEATURES }} -- -D warnings