fix(query): Properly handle format outcome (#893) #40
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 CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- .github/workflows/*.yml | |
- Cargo.toml | |
- crates/** | |
- src/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_TERM_COLOR: always | |
RUSTDOCFLAGS: "-Dwarnings" | |
RUSTUP_MAX_RETRIES: 10 | |
RUST_BACKTRACE: 1 | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
strategy: | |
matrix: | |
target: | |
- { os: ubuntu-latest, toolchain: stable, triple: x86_64-unknown-linux-gnu } | |
- { os: ubuntu-latest, toolchain: beta, triple: x86_64-unknown-linux-gnu } | |
- { os: ubuntu-latest, toolchain: nightly, triple: x86_64-unknown-linux-gnu } | |
- { os: windows-latest, toolchain: stable, triple: i686-pc-windows-msvc } | |
- { os: macos-latest, toolchain: stable, triple: x86_64-apple-darwin } | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.target.toolchain }} | |
targets: ${{ matrix.target.triple }} | |
- uses: taiki-e/install-action@nextest | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo nextest run --workspace --all-features --profile ci | |
- run: cargo test --doc --workspace --all-features --no-fail-fast | |
fuzz: | |
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 900 | |
strategy: | |
matrix: | |
item: | |
- { name: pica-record-ref, fuzz-dir: fuzz, target: fuzz-record-ref, max-total-time: 120 } | |
- { name: pica-record-matcher, fuzz-dir: fuzz, target: fuzz-record-matcher, max-total-time: 200 } | |
- { name: pica-path, fuzz-dir: fuzz, target: fuzz-path, max-total-time: 200 } | |
- { name: pica-format, fuzz-dir: fuzz, target: fuzz-format, max-total-time: 200 } | |
- { name: pica-query, fuzz-dir: fuzz, target: fuzz-query, max-total-time: 200 } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- uses: dtolnay/install@cargo-fuzz | |
- run: | | |
cargo fuzz run --fuzz-dir ${{ matrix.item.fuzz-dir }} --jobs 2 ${{ matrix.item.target }} -- -max_total_time=${{ matrix.item.max-total-time }} | |
rustfmt: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all --check | |
rustdoc: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo doc --no-deps | |
clippy: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --workspace --all-features | |
msrv: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --workspace --all-features | |
udeps: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo install --locked cargo-udeps | |
- run: cargo udeps --workspace | |
outdated: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
timeout-minutes: 45 | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo install --locked cargo-outdated | |
- run: cargo outdated -w -d 1 --exit-code 1 | |
deny: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
checks: | |
- bans licenses sources | |
- advisories | |
continue-on-error: ${{ matrix.checks == 'advisories' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
command: check ${{ matrix.checks }} | |
rust-version: stable | |
publish: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
needs: | |
- clippy | |
- deny | |
- fuzz | |
- msrv | |
- outdated | |
- rustdoc | |
- rustfmt | |
- test | |
- udeps | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: quarto-dev/quarto-actions/setup@v2 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tinytex: true | |
- uses: quarto-dev/quarto-actions/publish@v2 | |
with: | |
target: gh-pages | |
path: docs/book | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ci: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- run: exit 0 |