-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic CI via GitHub Actions (#10)
Closes #1.
- Loading branch information
1 parent
b4828fb
commit b059c59
Showing
7 changed files
with
110 additions
and
12 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,33 @@ | ||
[target.'cfg(all())'] | ||
rustflags = [ | ||
# CLIPPY LINT SETTINGS | ||
# This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML. | ||
# See: `https://github.com/rust-lang/cargo/issues/5034` | ||
# `https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395` | ||
"-Dunsafe_code", | ||
"-Wclippy::pedantic", | ||
# Allowed pedantic lints | ||
"-Wclippy::char_lit_as_u8", | ||
"-Aclippy::collapsible_else_if", | ||
"-Aclippy::collapsible_if", | ||
"-Aclippy::implicit_hasher", | ||
"-Aclippy::match_same_arms", | ||
"-Aclippy::missing_errors_doc", | ||
"-Aclippy::missing_panics_doc", | ||
"-Aclippy::module_name_repetitions", | ||
"-Aclippy::must_use_candidate", | ||
"-Aclippy::similar_names", | ||
"-Aclippy::too_many_lines", | ||
# Disallowed restriction lints | ||
"-Wclippy::print_stdout", | ||
"-Wclippy::print_stderr", | ||
"-Wclippy::dbg_macro", | ||
"-Wclippy::empty_drop", | ||
"-Wclippy::empty_structs_with_brackets", | ||
"-Wclippy::exit", | ||
"-Wclippy::get_unwrap", | ||
"-Wclippy::rc_buffer", | ||
"-Wclippy::rc_mutex", | ||
"-Wclippy::rest_pat_in_fully_bound_structs", | ||
"-Wunreachable_pub" | ||
] |
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,66 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_NET_RETRY: 10 | ||
CARGO_TERM_COLOR: always | ||
RUSTUP_MAX_RETRIES: 10 | ||
|
||
jobs: | ||
cargo-fmt: | ||
name: "cargo fmt" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Install Rust toolchain" | ||
run: rustup component add rustfmt | ||
- name: "rustfmt" | ||
run: cargo fmt --all --check | ||
|
||
cargo-clippy: | ||
name: "cargo clippy" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Install Rust toolchain" | ||
run: | | ||
rustup component add clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Clippy" | ||
run: cargo clippy --workspace --all-targets --all-features -- -D warnings | ||
|
||
cargo-test: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
runs-on: ${{ matrix.os }} | ||
name: "cargo test | ${{ matrix.os }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install cargo insta" | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-insta | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Tests (Ubuntu)" | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: cargo insta test --all --all-features --unreferenced reject | ||
- name: "Tests (Windows)" | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
shell: bash | ||
run: cargo insta test --all --all-features --unreferenced reject | ||
- run: cargo doc --all --no-deps | ||
env: | ||
RUSTDOCFLAGS: "-D warnings" |
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 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 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,2 @@ | ||
[toolchain] | ||
channel = "1.72" |