-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: reduce the number of CI jobs (#28)
With 3 operating systems, 3 rust versions, and 2 set of arguments for cargo-test, the combinations in the test matrix grew to 18 (3x3x2) jobs. This reduces the number of jobs while introduces tests in more platforms.
- Loading branch information
Showing
1 changed file
with
71 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,80 @@ | ||
name: Test suite | ||
|
||
on: [push, pull_request] | ||
|
||
name: Tests | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
tests: | ||
name: Run tests | ||
test: | ||
name: test | ||
env: | ||
CARGO_TERM_COLOR: always | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macOS-latest ] | ||
rust: | ||
- stable | ||
- nightly | ||
- 1.66.1 # Minimum Supported Rust Version (MSRV) | ||
cargo-test-args: | ||
- "--features=test_proto2-module,test_proto3-module,ascii-tree" | ||
- "--features=constant-folding,test_proto2-module,test_proto3-module,ascii-tree" | ||
env: | ||
CARGO_TERM_COLOR: always | ||
build: | ||
- msrv | ||
- stable | ||
- nightly | ||
- macos | ||
- win-msvc | ||
- win-gnu | ||
- constant-folding-off | ||
include: | ||
- build: msrv | ||
os: ubuntu-latest | ||
rust: 1.66.1 | ||
args: "" | ||
|
||
- build: stable | ||
os: ubuntu-latest | ||
rust: stable | ||
args: "" | ||
|
||
- build: nightly | ||
os: ubuntu-latest | ||
rust: nightly | ||
args: "" | ||
|
||
- build: macos | ||
os: macos-latest | ||
rust: stable | ||
args: "" | ||
|
||
- build: win-msvc | ||
os: windows-latest | ||
rust: stable | ||
args: "" | ||
|
||
- build: win-gnu | ||
os: windows-latest | ||
rust: stable-x86_64-gnu | ||
args: "" | ||
|
||
- build: constant-folding-off | ||
os: ubuntu-latest | ||
rust: stable | ||
args: "--no-default-features --features=test_proto2-module,test_proto3-module,ascii-tree" | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-targets --no-default-features ${{ matrix.cargo-test-args }} | ||
env: | ||
RUSTFLAGS: -Awarnings # Allow all warnings | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-targets ${{ matrix.args }} | ||
env: | ||
RUSTFLAGS: -Awarnings # Allow all warnings |