Skip to content

Commit

Permalink
chore: CIにtextlintの実行を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
3w36zj6 committed Nov 27, 2024
1 parent 68fd6fd commit 7be1c43
Showing 1 changed file with 23 additions and 64 deletions.
87 changes: 23 additions & 64 deletions .github/workflows/ci.yml
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

0 comments on commit 7be1c43

Please sign in to comment.