Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,58 @@ on:
permissions:
contents: read

env:
RUSTFLAGS: '-Dwarnings'

jobs:
test:
name: Test
lint:
name: Lint
runs-on: ubuntu-latest

env:
RUSTFLAGS: '-Dwarnings'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main

- name: Install crates
run: cargo binstall -y --force cargo-deny cargo-machete cargo-sort

- name: Lint
run: cargo clippy --locked

- name: Check dependencies
run: cargo deny check

- name: Check unused dependencies
run: cargo machete

- name: Check manifest formatting
run: cargo sort --workspace --check .

- name: Check formatting
run: cargo fmt --all --check

- name: Lint
run: cargo clippy --all-features --locked
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Test
run: cargo test --all-features --locked --release
3 changes: 1 addition & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
target: wasm32-unknown-unknown

- name: Install Cargo Binary Install
Expand All @@ -35,7 +34,7 @@ jobs:
run: cargo binstall --force -y trunk

- name: Install Node.js dependencies
run: npm install
run: npm ci

- name: Build Website
run: trunk build
Expand Down
37 changes: 31 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
language: node
additional_dependencies:
- prettier@^3.6.2

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: clippy

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
- repo: https://github.com/EmbarkStudios/cargo-deny
rev: 0.18.4
hooks:
- id: prettier
language: node
additional_dependencies:
- prettier@^3.4.1
- id: cargo-deny

# - repo: https://github.com/bnjbvr/cargo-machete
# rev: ba1bcd4
# hooks:
# - id: cargo-machete
- repo: local
hooks:
- id: cargo-machete
name: cargo-machete
language: rust
entry: cargo machete
types: [file, toml]
files: Cargo\.(toml|lock)
pass_filenames: false

- repo: https://github.com/DevinR528/cargo-sort
rev: v2.0.1
hooks:
- id: cargo-sort
args: ['.', '--workspace']
54 changes: 43 additions & 11 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/RustForWeb/rustforweb.github.io"
console_error_panic_hook = "0.1.7"
console_log = "1.0.0"
log = "0.4.22"
radix-yew-icons = { git = "https://github.com/RustForWeb/radix.git" }
# radix-yew-icons = { git = "https://github.com/RustForWeb/radix.git" }
radix-yew-themes = { git = "https://github.com/RustForWeb/radix.git" }
yew = { version = "0.21.0", features = ["csr"] }
yew-router = "0.18.0"
Expand Down
23 changes: 23 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[graph]
all-features = true

[advisories]
ignore = [
{ id = "RUSTSEC-2024-0370", reason = "No safe upgrade is available `proc-macro-error`." },
]

[bans]
allow-wildcard-paths = true
multiple-versions = "allow"
wildcards = "deny"

[licenses]
allow = ["Apache-2.0", "BSL-1.0", "MIT", "Unicode-3.0", "Zlib"]
confidence-threshold = 1.0

[sources]
unknown-git = "deny"
unknown-registry = "deny"

[sources.allow-org]
github = ["RustForWeb"]
9 changes: 4 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {},
"devDependencies": {
"@radix-ui/themes": "^3.1.6",
"prettier": "^3.4.1"
"prettier": "^3.6.2"
},
"engines": {
"node": ">=20"
Expand Down