Improved compiler errors when feature flags are missing #243
Workflow file for this run
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: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# When a new run is triggered by a commit while a run is already in progress, | |
# we want to cancel the in-progress run so as to not waste CI resources. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
# to fetch code (actions/checkout) | |
contents: read | |
env: | |
# https://doc.rust-lang.org/cargo/reference/config.html#registriescrates-ioprotocol | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse" | |
jobs: | |
test-wasm: | |
name: Test WASM | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
targets: wasm32-unknown-unknown | |
- name: Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "rust-stable-test" | |
- name: Install wasm-bindgen-cli | |
run: cargo install wasm-bindgen-cli | |
- name: Build xtask | |
run: cargo build --manifest-path ./xtask/Cargo.toml | |
- name: Run tests | |
run: cargo x test --wasm | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_TERM_COLOR: always | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [pinned, stable, nightly] | |
include: | |
- build: pinned | |
os: ubuntu-20.04 | |
rust: 1.72 | |
# Fails on pinned version because the output changed, | |
# so we're excluding it, but it's still tested on stable and nightly. | |
EXCLUDE_UI_TESTS: "pattern_mismatched_types,newtype,matches_unknown_field" | |
- build: stable | |
os: ubuntu-20.04 | |
rust: stable | |
EXCLUDE_UI_TESTS: "" | |
- build: nightly | |
os: ubuntu-20.04 | |
rust: nightly | |
EXCLUDE_UI_TESTS: "pattern_mismatched_types,non_unary_newtype" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "rust-${{ matrix.build }}-test" | |
- name: Build xtask | |
run: cargo build-xtask | |
- name: Build docs | |
run: cargo doc --all-features | |
- name: Run tests | |
run: cargo x test | |
env: | |
EXCLUDE_UI_TESTS: ${{ matrix.EXCLUDE_UI_TESTS }} | |
checks: | |
name: Checks | |
runs-on: ubuntu-20.04 | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt, clippy | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-deny,cargo-audit,cargo-udeps,cargo-pants | |
- name: Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "rust-checks" | |
- name: Build xtask | |
run: cargo build-xtask | |
- name: Run checks | |
run: cargo x check | |