-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace basic checks with pre-commit via action
- Loading branch information
1 parent
ef64ac0
commit 7e064bb
Showing
9 changed files
with
108 additions
and
115 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Basic Checks" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# 1. Check out repository | ||
- uses: actions/checkout@v4 | ||
|
||
# 2. Set up Rust nightly toolchain | ||
- name: Install Rust nightly | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ inputs.rust_nightly }} | ||
components: clippy, rustfmt | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
# 3. Set up Node.js for markdownlint | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "latest" | ||
|
||
- name: Install pre-commit | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip install pre-commit | ||
# 4. Run pre-commit hooks on all files | ||
- name: Run pre-commit | ||
run: pre-commit run --all-files | ||
|
||
# 5. Run linkspector | ||
- name: Run linkspector | ||
uses: umbrelladocs/action-linkspector@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
fail_on_error: true | ||
|
||
inputs: | ||
rust_nightly: | ||
description: "Rust nightly toolchain version" | ||
required: false | ||
default: "nightly" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
name: PR Checks | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
basics: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/actions/basics | ||
with: | ||
rust_nightly: nightly-2024-12-02 |
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,46 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
# Rustfmt formatting check | ||
- id: rustfmt | ||
name: Rustfmt | ||
language: system | ||
entry: rustfmt | ||
args: ["--edition", "2024", "--check"] | ||
pass_filenames: true | ||
files: \.rs$ | ||
|
||
# Cargo Clippy linting | ||
- id: cargo-clippy | ||
name: Cargo Clippy | ||
language: system | ||
entry: cargo | ||
args: | ||
[ | ||
"clippy", | ||
"--all", | ||
"--tests", | ||
"--all-features", | ||
"--no-deps", | ||
"--", | ||
"-D", | ||
"warnings", | ||
] | ||
pass_filenames: false | ||
|
||
# Cargo deny check | ||
- id: cargo-deny | ||
name: Cargo Deny | ||
language: system | ||
entry: cargo | ||
args: ["deny", "check"] | ||
pass_filenames: false | ||
|
||
# Markdown linting | ||
- id: markdownlint | ||
name: Markdownlint | ||
language: node | ||
entry: markdownlint | ||
args: ["--ignore", "node_modules"] | ||
pass_filenames: true | ||
files: \.md$ |
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 was deleted.
Oops, something went wrong.