Fix external #[cfg(fuzzing)]
builds
#132
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 | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-C debuginfo=0 --cfg fuzzing" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
toolchain: [stable, beta] | |
features: [ | |
'', | |
# Defaults to `syntect-onig`, so make sure to test `syntect-fancy` too | |
'--no-default-features --features=syntect-fancy', | |
'--all-features' | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ${{ matrix.toolchain }} toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: clippy, rustfmt | |
- name: Restore cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
# Can't have spaces in cache key. There's probably a cleaner way to do | |
# this | |
prefix-key: ${{ matrix.features }} | |
- name: Formatting | |
run: cargo fmt --all -- --check | |
# Don't include the `xtask` when running tests to avoid feature | |
# unification toggling things on | |
- name: Test | |
run: cargo test --package two-face ${{ matrix.features }} | |
- name: Clippy | |
run: cargo clippy --workspace ${{ matrix.features }} -- -D warnings | |
- name: Docs | |
env: | |
RUSTDOCFLAGS: -D warnings | |
run: cargo doc --no-deps --package two-face --all-features |