This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
test: add features case #99
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: Rust | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- run: rustup update stable && rustup default stable | |
- run: rustup component add rustfmt | |
- run: cargo fmt --all --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- run: rustup update stable && rustup default stable | |
- run: rustup component add clippy | |
- run: cargo clippy -- -D warnings | |
test: | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_PROFILE_DEV_DEBUG: 1 | |
CARGO_PROFILE_TEST_DEBUG: 1 | |
CARGO_INCREMENTAL: 0 | |
CARGO_PUBLIC_NETWORK_TESTS: 1 | |
# Deny warnings on CI to avoid warnings getting into the codebase. | |
RUSTFLAGS: -D warnings | |
strategy: | |
matrix: | |
include: | |
- name: Linux x86_64 stable | |
os: ubuntu-latest | |
rust: stable | |
- name: Linux x86_64 beta | |
os: ubuntu-latest | |
rust: beta | |
- name: Linux x86_64 nightly | |
os: ubuntu-latest | |
rust: nightly | |
- name: macOS x86_64 stable | |
os: macos-latest | |
rust: stable | |
- name: macOS x86_64 nightly | |
os: macos-latest | |
rust: nightly | |
- name: Windows x86_64 MSVC stable | |
os: windows-latest | |
rust: stable-msvc | |
- name: Windows x86_64 gnu nightly # runs out of space while trying to link the test suite | |
os: windows-latest | |
rust: nightly-gnu | |
name: Tests ${{ matrix.name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} | |
- run: cargo test |