Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: github workflow for clippy #10

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: "CI"

on:
push:
branches: [main]
pull_request:
branches:
- "**"
workflow_dispatch:
branches:
- "**"

jobs:
test:
name: CI Test Suite
runs-on: buildjet-32vcpu-ubuntu-2204
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22.1

- name: rust-cache
uses: buildjet/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
~/.rustup/
key: test-rust-nightly-2024-05-22-${{ hashFiles('**/Cargo.toml') }}
restore-keys: rust-nightly-2024-05-22-

- name: Install nightly toolchain
id: rustc-toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-05-22
override: true

lints:
name: Formatting & Clippy
runs-on: buildjet-32vcpu-ubuntu-2204
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22.1

- name: rust-cache
uses: buildjet/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
~/.rustup/
key: clippy-rust-nightly-2024-05-22-${{ hashFiles('**/Cargo.toml') }}
restore-keys: rust-nightly-2024-05-22-

- name: Install nightly toolchain
id: rustc-toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-05-22
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
env:
CARGO_INCREMENTAL: 1

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings -A incomplete-features
env:
CARGO_INCREMENTAL: 1
20 changes: 20 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: PR
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"incomplete-features"
],
"rust-analyzer.linkedProjects": [
"header-range/Cargo.toml",
"primitives/Cargo.toml",
"rotate/Cargo.toml",
"script/Cargo.toml",
"Cargo.toml",
],
"rust-analyzer.showUnlinkedFileNotification": false
}
Loading