Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
welf committed Jun 15, 2024
0 parents commit abc3b20
Show file tree
Hide file tree
Showing 19 changed files with 1,407 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/cargo-mutants.yml
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
105 changes: 105 additions & 0 deletions .github/workflows/rust_code_check.yml
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
26 changes: 26 additions & 0 deletions .github/workflows/rust_dependencies_audit.yml
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/target
/.tarpaulin-report
/.tarpaulin-reports
/mutants.*
.DS_Store
195 changes: 195 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
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"
8 changes: 8 additions & 0 deletions frontend/WebAssembly_Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/favicon.ico
Binary file not shown.
Loading

0 comments on commit abc3b20

Please sign in to comment.