Skip to content

Commit 50e8476

Browse files
ci: add 'just check' quality gate and CI workflow
check validates compose files (incl. overlays), Prometheus config+rules via promtool, the collector config via otelcol validate, yamllint, actionlint, and dashboard JSON — all in pinned containers, no host installs. CI runs 'just check' plus a smoke job that waits for Grafana /api/health. Also fixes a trailing space yamllint caught in dependabot.yml.
1 parent 771bc81 commit 50e8476

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: "docker-compose"
4-
directory: "/"
4+
directory: "/"
55
schedule:
66
interval: "weekly"
77
groups:

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Thin wrapper around the `just` contract: everything CI runs, you can run
2+
# locally with the same command.
3+
name: CI
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v7
15+
- uses: extractions/setup-just@v4
16+
- run: cp .env.example .env
17+
- run: just check
18+
19+
smoke:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v7
23+
- uses: extractions/setup-just@v4
24+
- run: cp .env.example .env
25+
- run: just up
26+
- name: Wait for Grafana to report healthy
27+
run: timeout 120 sh -c 'until curl -sf http://localhost:3000/api/health; do sleep 3; done'
28+
- run: just down

justfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,17 @@ pull:
3838
tail service:
3939
docker compose logs -f --no-log-prefix {{service}} | jq -R 'fromjson? // .'
4040

41+
# Validate everything. All validators run in containers — no host installs.
42+
check:
43+
docker compose config -q
44+
CLOUDFLARE_TUNNEL_TOKEN=dummy docker compose -f compose.yml -f compose.tunnel.yml config -q
45+
docker compose -f compose.yml -f compose.demo.yml config -q
46+
docker run --rm -v ./config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro -v ./config/alerts:/etc/prometheus/alerts:ro --entrypoint promtool prom/prometheus:v3.11.2 check config /etc/prometheus/prometheus.yaml
47+
docker run --rm -v ./config/otel-collector.yaml:/etc/otelcol/config.yaml:ro otel/opentelemetry-collector-contrib:0.150.1 validate --config=/etc/otelcol/config.yaml
48+
docker run --rm -v .:/code:ro pipelinecomponents/yamllint:0.35.13 yamllint -d relaxed .
49+
docker run --rm -v .:/repo:ro -w /repo rhysd/actionlint:1.7.12 -color
50+
jq empty dashboards/*.json
51+
52+
# Format YAML in place (needs yamlfmt on the host; optional).
53+
fmt:
54+
yamlfmt .

0 commit comments

Comments
 (0)