-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit abc3b20
Showing
19 changed files
with
1,407 additions
and
0 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,37 @@ | ||
name: cargo-mutants | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
# Only test PR if it changes something that's likely to affect the results, because | ||
# mutant tests can take a long time. Adjust these paths to suit your project. | ||
paths: | ||
- ".cargo/**" | ||
- ".github/workflows/mutants.yml" | ||
- "Cargo.*" | ||
- "src/**" | ||
- "testdata/**" | ||
- "tests/**" | ||
|
||
jobs: | ||
cargo-mutants: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: taiki-e/install-action@v2 | ||
name: Install cargo-mutants using install-action | ||
with: | ||
tool: cargo-mutants | ||
- name: Run mutant tests | ||
run: cargo mutants -vV --in-place | ||
- name: Archive results | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: mutants-out | ||
path: mutants.out |
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,105 @@ | ||
# Check PRs for formatting issues, linting issues, run tests, and check code coverage | ||
name: Code Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# Perform check if Rust files or the current file are modified only | ||
paths: | ||
- src/** | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/code_check.yml | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- src/** | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/code_check.yml | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run tests | ||
run: cargo test --all-features | ||
|
||
fmt: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: -D warnings | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Run cargo check | ||
run: cargo check | ||
|
||
- name: Check formatting | ||
run: | | ||
if ! cargo fmt --check ; then | ||
echo "Formatting errors detected, please run `cargo fmt` to fix it"; | ||
exit 1 | ||
fi | ||
lint: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Check linting | ||
run: cargo clippy --all-features -- -D warnings # handle clippy warnings as errors | ||
|
||
coverage: | ||
name: Code coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
# Install cargo-tarpaulin for code coverage | ||
- name: Install tarpaulin | ||
run: cargo install cargo-tarpaulin | ||
|
||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Check code coverage | ||
run: cargo tarpaulin --verbose --workspace |
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,26 @@ | ||
# Daily scan Rust dependencies for vulnerabilities | ||
name: Security Audit | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
push: | ||
paths: | ||
- Cargo.toml | ||
- Cargo.lock | ||
- .github/workflows/audit.yml | ||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install cargo-audit | ||
run: cargo install cargo-audit | ||
|
||
- name: Scan for vulnerabilities | ||
run: cargo audit --color always -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/target | ||
/.tarpaulin-report | ||
/.tarpaulin-reports | ||
/mutants.* | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,14 @@ | ||
[package] | ||
name = "rusty-minesweeper" | ||
authors = ["Arthur Welf"] | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.79.0" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
rand = "0.8.5" | ||
getrandom = { version = "0.2", features = ["js"] } | ||
wasm-bindgen = "0.2.92" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.