Add opt-in compatibility tests #36
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
name: Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Tests pass (debug) | |
run: | | |
cargo run --manifest-path test-crates/samplebin/Cargo.toml | |
continue-on-error: ${{ matrix.os == 'windows-latest' }} | |
- name: Tests pass (release) | |
run: | | |
cargo run --manifest-path test-crates/samplebin/Cargo.toml --release | |
continue-on-error: ${{ matrix.os == 'windows-latest' }} | |
- name: Add nightly | |
run: rustup toolchain add nightly | |
- name: Bin stable, mod_a nightly (should fail) | |
run: | | |
! cargo +stable run --manifest-path test-crates/samplebin/Cargo.toml -- --channel:mod_a=nightly | |
shell: bash | |
- name: Bin nightly, mod_a stable (should fail) | |
run: | | |
! cargo +nightly run --manifest-path test-crates/samplebin/Cargo.toml -- --channel:mod_a=stable | |
shell: bash | |
- name: All nightly (should work) | |
run: | | |
cargo +nightly run --manifest-path test-crates/samplebin/Cargo.toml -- --channel:mod_a=nightly --channel:mod_b=nightly | |
shell: bash | |
- name: Bin has mokio-timer feature (should fail) | |
run: | | |
! cargo run --features=exports/mokio-timer --manifest-path test-crates/samplebin/Cargo.toml | |
shell: bash | |
- name: mod_a has mokio-timer feature (should fail) | |
run: | | |
! cargo run --manifest-path test-crates/mod_a/Cargo.toml -- --features:mod_a=mokio/timer | |
shell: bash | |
- name: mod_b has mokio-timer feature (should fail) | |
run: | | |
! cargo run --manifest-path test-crates/mod_b/Cargo.toml -- --features:mod_b=mokio/timer | |
shell: bash | |
- name: all mods have mokio-timer feature (should fail) | |
run: | | |
! cargo run --manifest-path test-crates/samplebin/Cargo.toml -- --features:mod_a=mokio/timer --features:mod_b=mokio/timer | |
- name: bin and mods have mokio-timer feature (should work) | |
run: | | |
cargo run --features=exports/mokio-timer --manifest-path test-crates/samplebin/Cargo.toml -- --features:mod_a=mokio/timer --features:mod_b=mokio/timer | |
shell: bash |