-
Notifications
You must be signed in to change notification settings - Fork 134
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
12 changed files
with
204 additions
and
62 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
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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Check code formatting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/format.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/format.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: format-${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
format-${{ runner.os }}-cargo-${{ matrix.target }}- | ||
${{ runner.os }}-cargo-${{ matrix.target }}- | ||
# ----- Actual linting logic ------ | ||
# These lines should mirror the `just lint` command. | ||
- name: cargo fmt | ||
run: cargo fmt --all -- --check |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Lint the code docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/lint_docs.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/lint_docs.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
|
||
jobs: | ||
lint_docs: | ||
name: on ${{ matrix.os }} for ${{ matrix.target }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-pc-windows-msvc | ||
- x86_64-apple-darwin | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: lint-docs-${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
lint-docs-${{ runner.os }}-cargo-${{ matrix.target }}- | ||
${{ runner.os }}-cargo-${{ matrix.target }}- | ||
# ----- Actual linting logic ------ | ||
# These lines should mirror the `just lint` command. | ||
- name: cargo doc lints | ||
run: RUSTDOCFLAGS='-D warnings' cargo doc --document-private-items --no-deps | ||
if: ${{ !startsWith(matrix.os, 'windows') }} | ||
|
||
# These lines should mirror the `just lint` command. | ||
- name: cargo doc lints | ||
run: $env:RUSTDOCFLAGS='-D warnings'; cargo doc --document-private-items --no-deps | ||
if: startsWith(matrix.os, 'windows') |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Lint toml files | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/lint_toml.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/lint_toml.yml" | ||
- "**.rs" | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
|
||
jobs: | ||
lint_toml: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: lint-toml-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: lint-toml- | ||
|
||
# Only run taplo on linux to save some time. | ||
- name: Install taplo-cli | ||
run: cargo install taplo-cli || exit 0 | ||
if: matrix.target == 'x86_64-unknown-linux-gnu' | ||
|
||
- name: cargo sort | ||
run: ~/.cargo/bin/taplo format --check | ||
if: matrix.target == 'x86_64-unknown-linux-gnu' |
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
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
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
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
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
Oops, something went wrong.