Refactor highlighting #895
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: [master] | |
paths: | |
- "**.rs" | |
- "**.toml" | |
- ".github/workflows/rust.yml" | |
pull_request: | |
paths: | |
- "**.rs" | |
- "**.toml" | |
- ".github/workflows/rust.yml" | |
- "*.md" | |
env: | |
RUST_BACKTRACE: short | |
RUSTFLAGS: -Cdebuginfo=1 | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --workspace --all-targets | |
- name: Run tests | |
run: cargo test --workspace --all-targets | |
- name: Run doctests | |
run: cargo test --workspace --doc | |
- name: Test features | |
if: matrix.os != 'windows-latest' | |
run: cargo test --workspace --all-targets --all-features | |
- name: Clippy | |
run: cargo clippy --workspace --no-deps -- -D warnings | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Check with no default features | |
run: cargo check --workspace --no-default-features | |
env: | |
RUSTFLAGS: "-D warnings" | |
- name: Check split-highlight feature | |
run: | | |
cargo check --workspace --all-targets --features 'split-highlight' | |
cargo check --workspace --all-targets --features 'split-highlight ansi-str' | |
cargo check --workspace --all-targets --features 'split-highlight anstyle' | |
direct-minimal-versions: | |
name: Test min versions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- uses: hecrj/setup-rust-action@v2 | |
with: | |
rust-version: nightly | |
- run: | | |
cargo update -Z direct-minimal-versions | |
cargo test --workspace --all-targets |