Skip to content

Commit

Permalink
Merge pull request #397 from mgeisler/feature-build-matrix
Browse files Browse the repository at this point in the history
Split `build` job into separate jobs per feature configuration
  • Loading branch information
mgeisler committed Jun 27, 2021
2 parents 97c4f98 + def095b commit 7cec76d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ env:
jobs:

ubuntu:
name: Build on Ubuntu
name: Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
features:
- no default features
- all features
- default features

steps:
- name: Checkout repository
Expand All @@ -34,17 +38,18 @@ jobs:

- uses: Swatinem/rust-cache@v1

- name: Test with default features
run: cargo test

- name: Test without default features
run: cargo test --no-default-features

- name: Test with all features
run: cargo test --all-features
- name: Test with ${{ matrix.features }}
run: |
FLAG="${{ matrix.features }}"
if [[ "$FLAG" = "default features" ]]; then
FLAG='' # Needs no flag
else
FLAG="--${FLAG// /-}" # Turn 'foo bar' into '--foo-bar'
fi
cargo test $FLAG
windows:
name: Build on Windows (stable)
name: Windows (stable, default features)
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down

0 comments on commit 7cec76d

Please sign in to comment.