Skip to content
Open
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
64 changes: 26 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

name: ci
on: [push, pull_request]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Fix YAMLlint "truthy" warning for the on key.

Quote on to placate yamllint, or expand to a mapping. This keeps Actions happy and silences the linter.

Apply one of these diffs (either is fine):

Option A (quote the key):

-name: ci
-on: [push, pull_request]
+name: ci
+"on": [push, pull_request]

Option B (expand triggers and quote key):

-name: ci
-on: [push, pull_request]
+name: ci
+"on":
+  push:
+  pull_request:

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 2-2: truthy value should be one of [false, true]

(truthy)

🤖 Prompt for AI Agents
In .github/workflows/ci.yml around line 2 the top-level on key is written
without quotes which triggers yamllint's "truthy" warning; fix it by either
quoting the key (change on: to "on": [push, pull_request]) or expand it into a
mapping (e.g. "on": { push: { branches: [main] }, pull_request: { branches:
[main] } }) so the key is explicit and the linter warning is silenced.

jobs:
build-test:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
BUILD_PROFILE: debug
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: leynos/shared-actions/.github/actions/setup-rust@c6559452842af6a83b83429129dccaf910e34562
- name: Show Ninja version
run: ninja --version
- name: Format
run: make check-fmt
- name: Lint
run: make lint
- name: Test
run: make test
- name: Test and Measure Coverage
uses: leynos/shared-actions/.github/actions/generate-coverage@c6559452842af6a83b83429129dccaf910e34562
with:
output-path: lcov.info
format: lcov
- name: Upload coverage data to CodeScene
env:
CS_ACCESS_TOKEN: ${{ secrets.CS_ACCESS_TOKEN }}
if: ${{ env.CS_ACCESS_TOKEN }}
uses: leynos/shared-actions/.github/actions/upload-codescene-coverage@c6559452842af6a83b83429129dccaf910e34562
with:
format: lcov
access-token: ${{ env.CS_ACCESS_TOKEN }}
installer-checksum: ${{ vars.CODESCENE_CLI_SHA256 }}
- uses: actions/setup-node@v4
with: { node-version: '22' }
- uses: oven-sh/setup-bun@v1
with: { bun-version: '1.1.x' }

# Backend
- name: Rust build
run: |
sudo apt-get update && sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
cargo build --manifest-path backend/Cargo.toml --release --target x86_64-unknown-linux-musl
Comment on lines +15 to +19
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Install a Rust toolchain before invoking cargo.

The runner does not ship with Rust by default; cargo will fail with “command not found”. Install the toolchain and the MUSL target explicitly.

Apply this diff to insert a toolchain setup step before the build:

       - uses: actions/checkout@v4
+      - uses: dtolnay/rust-toolchain@stable
+        with:
+          targets: x86_64-unknown-linux-musl
       - uses: actions/setup-node@v4
-        with: { node-version: '22' }
+        with:
+          node-version: '22'
       - uses: oven-sh/setup-bun@v1
-        with: { bun-version: '1.1.x' }
+        with:
+          bun-version: '1.1.x'
 
       # Backend
       - name: Rust build
         run: |
           sudo apt-get update && sudo apt-get install -y musl-tools
-          rustup target add x86_64-unknown-linux-musl
           cargo build --manifest-path backend/Cargo.toml --release --target x86_64-unknown-linux-musl
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Rust build
run: |
sudo apt-get update && sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
cargo build --manifest-path backend/Cargo.toml --release --target x86_64-unknown-linux-musl
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: oven-sh/setup-bun@v1
with:
bun-version: '1.1.x'
# Backend
- name: Rust build
run: |
sudo apt-get update && sudo apt-get install -y musl-tools
cargo build --manifest-path backend/Cargo.toml --release --target x86_64-unknown-linux-musl
🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 14 to 18: the workflow invokes cargo but
never installs a Rust toolchain; add a step before the Rust build to install and
configure Rust (for example install rustup or use actions-rs/toolchain), set a
default toolchain (e.g., stable), ensure rustup is on PATH, then add the
x86_64-unknown-linux-musl target and proceed with the existing apt-get
musl-tools and cargo build; ensure the new step runs before the cargo build step
so cargo is available.


# OpenAPI dump (at runtime or via a small bin)
- name: Run backend to extract OpenAPI
run: |
# In real CI, run a small bin that prints ApiDoc JSON to stdout
echo "{}" > spec/openapi.json
Comment thread
leynos marked this conversation as resolved.

# Frontend
- name: Build tokens & PWA
run: |
cd packages/tokens && bun install && bun run build
cd ../../frontend-pwa && bun install && bun run build
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Rust
**/target/
/target

# Node
node_modules/
/frontend-pwa/node_modules/
/packages/tokens/node_modules/
/frontend-pwa/dist/
/packages/tokens/dist/

# Misc
.DS_Store
54 changes: 24 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
.PHONY: help all clean test build release lint fmt check-fmt markdownlint nixie
.PHONY: be fe openapi gen docker-up docker-down fmt lint test check-fmt markdownlint
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Declare all, clean, and audit phony targets.

Satisfy checkmake warnings and add a top-level audit to support the PR’s testing commands.

Apply this diff:

-.PHONY: be fe openapi gen docker-up docker-down fmt lint test check-fmt markdownlint
+.PHONY: all clean audit be fe openapi gen docker-up docker-down fmt lint test check-fmt markdownlint
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.PHONY: be fe openapi gen docker-up docker-down fmt lint test check-fmt markdownlint
.PHONY: all clean audit be fe openapi gen docker-up docker-down fmt lint test check-fmt markdownlint
🧰 Tools
🪛 checkmake (0.2.2)

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)

🤖 Prompt for AI Agents
In Makefile around lines 1 to 1, the .PHONY list is missing targets and emits
checkmake warnings; add all, clean, and audit to the .PHONY declaration
alongside the existing be fe openapi gen docker-up docker-down fmt lint test
check-fmt markdownlint entries, and create a top-level audit target that runs
the repository-level checks used by PR test commands (for example invoking
checkmake, lint, fmt checks and any CI-style validation scripts). Ensure the
audit target exits non-zero on failures and that clean is declared phony as well
so checkmake warnings are resolved.


APP ?= wildside
CARGO ?= cargo
BUILD_JOBS ?=
CLIPPY_FLAGS ?= --all-targets --all-features -- -D warnings
MDLINT ?= markdownlint
NIXIE ?= nixie
be:
cargo run --manifest-path backend/Cargo.toml

build: target/debug/$(APP) ## Build debug binary
release: target/release/$(APP) ## Build release binary
fe:
cd frontend-pwa && bun dev

all: release ## Default target builds release binary
openapi:
# Replace with a bin that prints OpenAPI
curl -s http://localhost:8080/api-docs/openapi.json > spec/openapi.json

clean: ## Remove build artifacts
$(CARGO) clean
gen:
cd frontend-pwa && bunx orval --config orval.config.yaml

test: ## Run tests with warnings treated as errors
RUSTFLAGS="-D warnings" $(CARGO) test --all-targets --all-features $(BUILD_JOBS)
docker-up:
cd deploy && docker compose up --build -d

target/%/$(APP): ## Build binary in debug or release mode
$(CARGO) build $(BUILD_JOBS) $(if $(findstring release,$(@)),--release) --bin $(APP)
docker-down:
cd deploy && docker compose down

lint: ## Run Clippy with warnings denied
$(CARGO) clippy $(CLIPPY_FLAGS)
fmt:
cargo fmt --manifest-path backend/Cargo.toml --all

fmt: ## Format Rust and Markdown sources
$(CARGO) fmt --all
mdformat-all

check-fmt: ## Verify formatting
$(CARGO) fmt --all -- --check
lint:
cargo clippy --manifest-path backend/Cargo.toml --all-targets --all-features -- -D warnings

markdownlint: ## Lint Markdown files
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 -- $(MDLINT)
test:
RUSTFLAGS="-D warnings" cargo test --manifest-path backend/Cargo.toml --all-targets --all-features

nixie: ## Validate Mermaid diagrams
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 -n 1 -- $(NIXIE)
check-fmt:
cargo fmt --manifest-path backend/Cargo.toml --all -- --check

help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS=":"; printf "Available targets:\n"} {printf " %-20s %s\n", $$1, $$2}'
markdownlint:
find . -type f -name '*.md' -not -path './target/*' -print0 | xargs -0 -- markdownlint
Loading
Loading