Skip to content

Commit

Permalink
Merge pull request #81 from gendx/workflows
Browse files Browse the repository at this point in the history
Migrate GitHub actions to dtolnay/rust-toolchain.
  • Loading branch information
gendx committed Aug 23, 2022
2 parents 50f07fc + 38d9c5d commit a24679d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 61 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/benches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ jobs:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: dtolnay/rust-toolchain@nightly
- name: Build benches
run: cargo build --benches --verbose
15 changes: 15 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on: [push, pull_request]
name: Formatting on stable toolchain
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
run: cargo fmt -- --check
- name: Check formatting on fuzzing
run: cargo fmt --manifest-path fuzz/Cargo.toml -- --check
6 changes: 1 addition & 5 deletions .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ jobs:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: dtolnay/rust-toolchain@nightly
- name: Install cargo fuzz
run: cargo install cargo-fuzz
- name: Build fuzz targets
Expand Down
40 changes: 8 additions & 32 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,19 @@
on: [push, pull_request]
name: Lints on stable toolchain
jobs:
lints:
clippy:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Check formatting on fuzzing
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path fuzz/Cargo.toml -- --check
components: clippy

- name: Check Clippy lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings -W clippy::match-same-arms

run: cargo clippy -- -W clippy::match-same-arms
- name: Check Clippy lints on tests
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests -- -D warnings -W clippy::match-same-arms

run: cargo clippy --tests -- -W clippy::match-same-arms
- name: Check Clippy lints on fuzzing
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path fuzz/Cargo.toml -- -D warnings -W clippy::match-same-arms
run: cargo clippy --manifest-path fuzz/Cargo.toml -- -W clippy::match-same-arms
25 changes: 6 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,15 @@ jobs:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- name: Build with default features
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
run: cargo build --verbose
- name: Tests with default features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
run: cargo test --verbose
- name: Build with all features
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features --verbose
run: cargo build --all-features --verbose
- name: Tests with all features
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --verbose
run: cargo test --all-features --verbose

0 comments on commit a24679d

Please sign in to comment.