foundation/.forgejo/workflows/ecosystem-selftest.yml
Andreas Niemann 35dc008759
All checks were successful
CI / preflight (push) Successful in 5s
CI / typecheck (push) Successful in 15s
ecosystem-selftest / semantic-release-bumptest (push) Successful in 13s
ecosystem-selftest / eslint-gate (push) Successful in 3s
ecosystem-selftest / yamllint-gate (push) Successful in 3s
pulumi-preview / preview (push) Successful in 16s
refactor(ci): composite actions instead of reusable workflows (Forgejo 11)
Forgejo 11.0.15 does NOT support reusable workflows (job-level `uses:` /
`workflow_call`): the call is silently dropped and no run is scheduled (verified
live — a same-repo and a cross-repo reusable call both produced zero runs, while
an equivalent inline job ran green). The working cross-repo reuse primitive here
is the COMPOSITE ACTION referenced by FULL URL (a short-form
`uses: olsitec/foundation/...@master` resolves against the runner's
DEFAULT_ACTIONS_URL = data.forgejo.org, not the local instance, and 404s; the
full-URL form `uses: https://forge.olsitec.net/olsitec/foundation/actions/<x>@master`
was verified green).

- Replace the four reusable-*.yml with composite actions under actions/:
  node-build, docker-build, lint, semantic-release-version (same logic + inputs).
- actions/README.md documents the pattern, the Forgejo-11 limitation, and the
  999_testing candidate coverage (C2/C3/C4 self-contained; C1/C5 blocked on the
  not-yet-published @olsitec package registry).
- ecosystem-selftest paths filter: actions/** (was reusable-*.yml).

The capabilities that need no external repo (semantic-release bump sequence,
eslint/yamllint gates) keep running green via ecosystem-selftest's inline jobs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 01:14:51 +02:00

66 lines
2.4 KiB
YAML

# ecosystem-selftest — proves the foundation's ecosystem-CI capabilities on its own
# runner (documentation/999_testing.md), without depending on external candidate
# repos. Three self-contained jobs, each asserting an acceptance criterion:
# - semantic-release: the bump sequence 1.0.0→1.1.0→1.1.1→2.0.0→3.0.0
# - eslint-gate: an eslint error makes the job exit non-zero
# - yamllint-gate: a yamllint error makes the job exit non-zero
# Build-shape coverage (npm/bun/docker) is exercised by the reusable-* workflows
# against the real candidate repos; this file guards the capabilities that need no
# external repo. Runs in the baked foundation-ci image.
name: ecosystem-selftest
on:
push:
paths:
- "ci/**"
- ".forgejo/workflows/ecosystem-selftest.yml"
- "actions/**"
workflow_dispatch:
jobs:
semantic-release-bumptest:
runs-on: docker
container:
image: foundation-ci:latest
steps:
- uses: actions/checkout@v4
- name: semantic-release bump sequence
run: ./ci/semantic-release-bumptest.sh
eslint-gate:
runs-on: docker
container:
image: foundation-ci:latest
steps:
- uses: actions/checkout@v4
- name: an eslint error must fail the job (exit non-zero)
run: |
set -e
d=$(mktemp -d); cd "$d"
# flat config (eslint 9) with no-unused-vars as an error
cat > eslint.config.mjs <<'EOF'
export default [{ rules: { "no-unused-vars": "error" } }];
EOF
printf 'const x = 1;\n' > bad.js # x is unused → error
if eslint bad.js; then
echo "BUG: eslint passed on a file with an error"; exit 1
else
echo "OK: eslint exited non-zero on the lint error"
fi
yamllint-gate:
runs-on: docker
container:
image: foundation-ci:latest
steps:
- uses: actions/checkout@v4
- name: a yamllint error must fail the job (exit non-zero)
run: |
set -e
d=$(mktemp -d); cd "$d"
# duplicate key + bad indentation → yamllint error
printf 'a: 1\na: 2\n' > bad.yaml
if yamllint -d '{extends: default, rules: {document-start: disable}}' bad.yaml; then
echo "BUG: yamllint passed on a file with a duplicate key"; exit 1
else
echo "OK: yamllint exited non-zero on the lint error"
fi