Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
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
8 changes: 7 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Rust build dir
# Rust
/target
/rust-toolchain.toml

# Rust tests
/tests/
Expand All @@ -10,3 +11,8 @@
# Docker
/Dockerfile
/docker-compose.yml

# Moon
/.moon/cache
/.moon/hooks
/.moon/docker
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: cd
cache-on-failure: true
cache-all-crates: true
cache-workspace-crates: true

- name: Check code for errors
run: cargo check

- name: Check code format
run: cargo fmt --check
- name: Set up toolchain
uses: moonrepo/setup-toolchain@v0
with:
auto-install: true

- name: Check code for lint errors
run: cargo clippy -- --deny warnings
- name: Checks
run: moon ci --color

- name: Run tests
run: cargo test
- name: Run report
uses: moonrepo/run-report-action@v1
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Rust
/target
/rust-toolchain.toml

# environment variables
.env*
!.env.example
!.env.test
!.env.test

# Moon
/.moon/cache
/.moon/hooks
/.moon/docker
7 changes: 7 additions & 0 deletions .moon/tasks/rust-backend-application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://moonrepo.dev/schemas/tasks.json

tasks:
run:
command: cargo run
description: Run a binary or example of the local package
preset: server
58 changes: 58 additions & 0 deletions .moon/tasks/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=https://moonrepo.dev/schemas/tasks.json

fileGroups:
sources:
- src/**/*
- Cargo.toml
- .env
tests:
- tests/**/*

tasks:
build:
command: cargo build
description: Compile a local package and all of its dependencies
local: true
inputs:
- "@globs(sources)"
run:
command: cargo run
description: Run a binary or example of the local package
local: true
inputs:
- "@globs(sources)"
test:
command: cargo test
description: Execute all unit and integration tests and build examples of a local package
inputs:
- "@globs(sources)"
- "@globs(tests)"
bacon:
command: bacon
description: bacon watches your project and runs jobs in background
preset: watcher
check:
command: cargo check
description: Check a local package and all of its dependencies for errors
inputs:
- "@globs(sources)"
fmt:
command: cargo fmt
description: This utility formats all bin and lib files of the current crate using rustfmt
local: true
inputs:
- "@globs(sources)"
fmt/check:
extends: fmt
local: false
args: ["--check"]
clippy:
command: cargo clippy
description: hecks a package to catch common mistakes and improve your Rust code
local: true
inputs:
- "@globs(sources)"
clippy/check:
extends: clippy
local: false
args: ["--", "--deny", "warnings"]
18 changes: 18 additions & 0 deletions .moon/toolchain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://moonrepo.dev/schemas/toolchain.json

rust:
version: 1.89.0
syncToolchainConfig: true
binstallVersion: 1.14.4
components:
- clippy
- rustfmt
bins:
- bin: bacon@3.17.0
local: true
- bin: cargo-edit@0.13.6
local: true
- bin: surrealdb-migrations@2.3.0
local: true
- bin: systemfd@0.4.6
local: true
17 changes: 17 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# yaml-language-server: $schema=https://moonrepo.dev/schemas/workspace.json

projects:
- "."

experiments:
fasterGlobWalk: true
gitV2: true

vcs:
defaultBranch: main
manager: git
provider: github
syncHooks: true
hooks:
pre-commit:
- moon :check :fmt/check :clippy/check :test --affected --status=staged --no-bail
5 changes: 5 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
moon = "1.39.4"
proto = "0.51.6"

[settings]
auto-install = true
6 changes: 6 additions & 0 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"label": "moon subscriptions:bacon",
"command": "moon subscriptions:bacon"
}
]
Loading
Loading