foundation/.forgejo/workflows/ecosystem-selftest.yml
Andreas Niemann 290f48ba18
All checks were successful
CI / preflight (push) Successful in 4s
CI / typecheck (push) Successful in 15s
ecosystem-selftest / semantic-release-bumptest (push) Successful in 12s
ecosystem-selftest / eslint-gate (push) Successful in 4s
ecosystem-selftest / yamllint-gate (push) Successful in 4s
pulumi-preview / preview (push) Successful in 18s
revert(ci): reusable workflows after all — Forgejo 11 supports them
Correction to the previous commit. Forgejo 11.0.15 DOES support reusable
workflows; my earlier "not supported" was a false negative — the test caller
omitted `runs-on`, and the pre-v15 "limited" implementation REQUIRES `runs-on`
on the calling job (omitting it makes Forgejo silently schedule no run). Verified
live: a caller with `runs-on` runs green, same-repo and cross-repo (short ref);
the full-URL form fails for reusable workflows (it was only needed for composite
ACTIONS, which resolve via DEFAULT_ACTIONS_URL).

- Restore the four reusable-*.yml (on: workflow_call), the architecture the
  handover + 999_testing chose; fix the caller examples to include `runs-on`.
- Remove the composite-action layer (actions/) — single mechanism, no redundancy.
- .forgejo/workflows/README.md documents the v11 caller-`runs-on` + short-ref
  quirks (both removed by a future Forgejo v15 upgrade) and the candidate coverage.
- ecosystem-selftest paths filter back to reusable-*.yml.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 01:48:29 +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"
- ".forgejo/workflows/reusable-*.yml"
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