ci: add clippy/rustfmt workflow (#663)

This commit is contained in:
uncenter 2024-02-12 02:12:49 -05:00 committed by GitHub
parent 4b1783765f
commit 3213674dc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 51 additions and 15 deletions

41
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: |
rustup toolchain install stable --profile minimal
rustup component add clippy
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --all
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust toolchain
run: |
rustup toolchain install nightly --profile minimal
rustup component add rustfmt --toolchain nightly
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Rustfmt
run: cargo +nightly fmt --all -- --check

View File

@ -7,7 +7,7 @@ on:
- cron: "10 * * * *"
jobs:
noResponse:
no-response:
runs-on: ubuntu-latest
permissions:
issues: write

View File

@ -9,7 +9,6 @@ jobs:
release:
permissions:
contents: write
strategy:
matrix:
include:
@ -25,13 +24,11 @@ jobs:
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install stable toolchain
- name: Setup Rust toolchain
run: rustup toolchain install stable --profile minimal
- name: Add aarch64 target
@ -44,7 +41,7 @@ jobs:
sudo apt-get update
sudo apt-get install -yq gcc-aarch64-linux-gnu
- name: Cache dependencies
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Build

View File

@ -2,9 +2,9 @@ name: Test
on:
push:
branches: ["main"]
branches: [main]
pull_request:
branches: ["main"]
branches: [main]
env:
CARGO_TERM_COLOR: always
@ -14,20 +14,18 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install stable toolchain
- name: Setup Rust toolchain
run: rustup toolchain install stable --profile minimal
- name: Cache dependencies
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Run tests
- name: Test
run: cargo test --verbose