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

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use explicit hashes for the workflow versions

- uses: dtolnay/rust-toolchain@1.97.0
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. I'd run format and lint on the same one


lint:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.97.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run Clippy
run: cargo clippy --locked --all-targets --all-features --

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make the lint job pass on the scaffold

This CI step currently exits non-zero because the API crate denies the full clippy::pedantic/clippy::nursery groups and the newly added code already trips denied lints, e.g. api/src/routes/health.rs::handler is async without any .await (unused_async) and api/src/routes/mod.rs::handler returns a value without #[must_use] (must_use_candidate). Since this job runs on every PR and push to main, the scaffold cannot get a green CI run until those lints are fixed or explicitly allowed.

Useful? React with 👍 / 👎.


build:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.97.0
- uses: Swatinem/rust-cache@v2
- name: Build debug
run: cargo build --locked --verbose
- name: Build release

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure building debug and release is adding much, I'd just build release, the debug version is implicitly built for tests

run: cargo build --locked --release --verbose

test:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.97.0
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --locked --all --verbose

deny:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
name: Cargo deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}
rust-version: 1.97.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop this to avoid having another source of truth for rust version

17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Rust
target/
**/*.rs.bk

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Environment
.env
.env.local
Loading
Loading