-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,29 @@ | ||
name: Continuous integration | ||
on: [push, pull_request, merge_group] | ||
name: CI | ||
|
||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
RUSTDOCFLAGS: "-Dwarnings" | ||
TYPST_TESTS_EXTENDED: true | ||
on: | ||
push: | ||
|
||
jobs: | ||
# This allows us to have one branch protection rule for the full test matrix. | ||
# See: https://github.com/orgs/community/discussions/4324 | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
needs: [test-matrix] | ||
if: always() | ||
textlint-md: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Tests successful | ||
if: ${{ !(contains(needs.*.result, 'failure')) }} | ||
run: exit 0 | ||
- name: Tests failing | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
run: exit 1 | ||
- name: Checkout the repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- name: Setup tools | ||
uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2 | ||
- name: Install dependencies | ||
run: bun install --frozen-lockfile | ||
- name: Lint Markdown using textlint | ||
run: bun run --bun textlint-md | ||
|
||
test-matrix: | ||
name: Tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
textlint-html: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.81.0 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo test --workspace --no-run | ||
- run: cargo test --workspace --no-fail-fast | ||
|
||
checks: | ||
name: Check clippy, formatting, and documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.81.0 | ||
with: | ||
components: clippy, rustfmt | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo clippy --workspace --all-targets --all-features | ||
- run: cargo fmt --check --all | ||
- run: cargo doc --workspace --no-deps | ||
|
||
min-version: | ||
name: Check minimum Rust version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@1.77.0 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo check --workspace | ||
|
||
fuzz: | ||
name: Check fuzzers | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2024-06-01 | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: cargo install --locked cargo-fuzz@0.12.0 | ||
- run: cd tests/fuzz && cargo fuzz build --dev | ||
- name: Checkout the repository | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- name: Setup tools | ||
uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2 | ||
- name: Install dependencies | ||
run: bun install --frozen-lockfile | ||
- name: Lint HTML using textlint | ||
run: bun run --bun textlint-html |