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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- main
- dev
pull_request:

# Only keep the latest run per branch/PR to save CI minutes.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
rust-all:
name: Rust (fmt, clippy, test, doc, shear)
runs-on: ubuntu-latest
Comment thread
Aderinom marked this conversation as resolved.
env:
# Cache compilation output between runs via sccache.
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: "0"
steps:
- uses: actions/checkout@v4

# Starts the sccache server used by RUSTC_WRAPPER above.
- name: Start sccache
uses: mozilla-actions/sccache-action@v0.0.9

# Runs every default workflow in a single step
- name: Run Rust workflows
uses: aderinom/rust-all-action@v1
with:
run: fmt,clippy,test,doc,shear,deny
flow-fmt-toolchain: nightly
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
target
Cargo.lock
Cargo.lock

# Vendored rust-all-action bundle for local CI (scripts/ci-local.sh)
/.tools/
21 changes: 21 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Requires nightly rustfmt to be installed.

# Comments Formatting
comment_width = 100
wrap_comments = true
format_code_in_doc_comments = true
normalize_comments = true # replace `/*comment*/ with `// comment` where possible

# Imports Formatting
imports_granularity = "Crate" # Groups imports by their source crate
group_imports = "StdExternalCrate" # Orders imports by STD, External, Internal

# Enum Formatting
enum_discrim_align_threshold = 4 # Vertical Align enum assignments by up to N characters

# Block and Closure Formatting
force_multiline_blocks = true # Force multiline closures to be wrapped in a block

# Patterns Formatting
condense_wildcard_suffixes = true # Replace (a, _, _) = (1,2,3) with (a, ..) = (1,2,3)
use_field_init_shorthand = true # A{ x: x } becomes A { x }
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cSpell.words": [
"oneshot",
"wrapp"
],
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
]
}
Comment thread
Aderinom marked this conversation as resolved.
27 changes: 27 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "clippy-watch",
"type": "shell",
"command": "cargo watch -x clippy",
"isBackground": true,
"problemMatcher": {
"base": "$rustc",
"background": {
"activeOnStart": true,
"beginsPattern": "^\\[Running 'cargo clippy'\\]",
"endsPattern": "^\\[Finished running\\. Exit status: [0-9]+\\]"
}
},
"presentation": {
"reveal": "never",
"panel": "dedicated",
"clear": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}
Loading
Loading