Skip to content

Commit

Permalink
Add Clippy and rustfmt workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed May 8, 2024
1 parent 62c9560 commit 9ce7c92
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/benches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Benches

on:
pull_request:
paths:
- ".github/workflows/benches.yml"
- "benches/**"

jobs:
benches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy, rustfmt
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all --all-targets -- -D warnings
- name: Build
run: RUSTFLAGS=-Dwarnings cargo build --all-targets
33 changes: 33 additions & 0 deletions .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Workspace

on:
pull_request:
paths-ignore:
- README.md
- "benches/**"
push:
branches: master
paths-ignore:
- README.md
- "benches/**"

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.78.0
components: clippy
- run: cargo clippy --all --all-targets -- -D warnings

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ unbiased = []

[workspace]
members = [
"benches",
"rand_core",
"rand_distr",
"rand_chacha",
"rand_pcg",
]
exclude = ["benches"]

[dependencies]
rand_core = { path = "rand_core", version = "=0.9.0-alpha.1", default-features = false }
Expand Down

0 comments on commit 9ce7c92

Please sign in to comment.