name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-24.04
services:
redis:
image: redis:8-alpine
ports: ["6379:6379"]
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: test
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
RUSTCLAMP_TEST_REDIS_URL: redis://127.0.0.1:6379/1
RUSTCLAMP_TEST_DATABASE_URL: postgres://postgres:test@127.0.0.1:5432/postgres?sslmode=disable
steps:
- uses: actions/checkout@v7
with:
path: rustclamp
- uses: actions/checkout@v7
with:
repository: rustclamp/core
path: core
- uses: actions/checkout@v7
with:
repository: rustclamp/kernel
path: kernel
- name: Facade
working-directory: rustclamp
run: |
cargo fmt --check
# boundaries.py reads offline metadata for every target, wasm-only crates included
cargo fetch
cargo clippy --all-features --all-targets -- -D warnings
cargo test --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
- name: Tooling
working-directory: rustclamp/tooling
run: |
cargo fmt --check
cargo clippy --locked --all-targets -- -D warnings
cargo test --locked
- uses: actions/setup-node@v5
with:
node-version: 24
- name: Web kits
working-directory: rustclamp/tooling
run: |
cargo build --locked --bin clamp
for kit in web vue react; do
./target/debug/clamp init "$RUNNER_TEMP/kit-$kit" --$kit
(cd "$RUNNER_TEMP/kit-$kit" && npm ci --no-audit --no-fund && npm run build)
done
examples:
runs-on: ubuntu-24.04
env:
RUSTCLAMP_TEST_MQTT_URL: mqtt://127.0.0.1:1883
steps:
- name: Mosquitto
run: docker run -d -p 1883:1883 eclipse-mosquitto:2 mosquitto -c /mosquitto-no-auth.conf
- uses: actions/checkout@v7
with:
path: rustclamp
- name: Siblings
run: |
for repo in core kernel runtime http postgres messaging worker scheduler; do
git clone --depth 1 "https://github.com/rustclamp/$repo" "$repo"
done
- name: Fetch
run: |
find . -name Cargo.lock -not -path '*/target/*' -print0 |
xargs -0 -n1 dirname | xargs -I{} cargo fetch --manifest-path {}/Cargo.toml
python3 rustclamp/tools/workspace.py --root .
cargo generate-lockfile
cargo fetch
- name: tools/check.py
run: python3 rustclamp/tools/check.py --root .