Files
runner-test/.github/workflows/04-setup-runtime.yml
T
tqcq 703410dc3d
Setup Runtime (C4) / setup-go (push) Successful in 2s
Gitea Actions Compatibility Suite / probe (push) Successful in 1s
Checkout Variants (C1) / checkout-variants (push) Successful in 3s
Setup Runtime (C4) / setup-java (push) Successful in 45s
Setup Runtime (C4) / setup-node (push) Successful in 3s
Setup Runtime (C4) / setup-python (push) Successful in 3s
Artifacts v3+v4 round-trip / producer (push) Successful in 3s
C3 cache / restore (push) Successful in 44s
C3 cache / seed (push) Successful in 44s
C5 - Contexts / consume needs output (push) Successful in 1s
C5 - Contexts / github/env/token/secrets/status-fns (push) Successful in 1s
C5 - Contexts / failure-test (push) Successful in 0s
C5 - Contexts / produce needs output (push) Successful in 1s
06 Workflow Commands / workflow-commands (push) Successful in 1s
C7 - services / services (postgres + redis, healthcheck-gated) (push) Successful in 1s
C7 - services / container (node:20, bash present) (push) Successful in 13s
C8 - Composite Action and Reusable Workflow / composite-reusable (push) Successful in 0s
09-control-flow / timeout + continue-on-error + concurrency (push) Successful in 1m1s
Artifacts v3+v4 round-trip / consumer (push) Successful in 0s
Gitea Divergences (C10) / environment-result-check (push) Successful in 2s
Gitea Divergences (C10) / environment-non-blocking (push) Successful in 0s
Gitea Divergences (C10) / problem-matcher-emit (push) Successful in 1s
Gitea Divergences (C10) / upload-artifact-v4-reconfirm (push) Successful in 0s
feat: Gitea Actions compatibility test suite
A self-validating test suite that proves Gitea's implementations of
GitHub-style actions behave like GitHub's. Push to any Gitea instance
with a registered runner — on push or manual dispatch, it runs 10
independent test workflows covering checkout, artifacts, caching,
language setup, expression contexts, workflow commands, services,
composite/reusable workflows, control flow, and known divergences.

Components:
- lib/assert.sh — self-asserting shell helper library (assert_eq,
  assert_contains, assert_exists, assert_not_exists, assert_match,
  sha256_of) with verified negative fail path
- 10 reusable workflows (on: workflow_call):
  01-checkout, 02-artifacts, 03-cache, 04-setup-runtime,
  05-contexts, 06-workflow-commands, 07-services,
  08-composite-reusable, 09-control-flow, 10-gitea-divergences
- 00-suite-runner.yml — sole entry (on: push + workflow_dispatch):
  probe gate (Gitea >= 1.22.0) -> c1-c10 parallel callers
  (c5/c8 forward secrets: inherit for act_runner #125) ->
  aggregate (if: always, skipped-as-failure)
- Fixtures: LFS 5MB binary, git tag v1-test, 4 language lockfiles
  (npm/go/pip/maven), sparse-cone layout
- Makefile: make lint (actionlint static gate)
- README: prerequisites, per-test expectations, correction table,
  manual eyeball checklist for UI-only behaviors
2026-07-08 02:05:11 +00:00

123 lines
4.0 KiB
YAML

---
name: Setup Runtime (C4)
on: [push, workflow_dispatch]
permissions:
contents: read
# C4: Proves setup-node / setup-python / setup-go / setup-java (Temurin, Maven)
# install the requested runtime and that each action's built-in `cache:` option
# resolves against the committed lockfiles (package-lock.json, go.sum,
# requirements.txt, pom.xml). Driven by a 4-way matrix; per-tool steps are gated
# with `if: matrix.tool == '<tool>'` so each leg exercises one action and one
# version assertion. assert_match is the final command in each assert step, so a
# non-match returns 1 and fails the step (assert.sh never sets `set -e`).
jobs:
setup-runtime:
name: setup-${{ matrix.tool }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
tool: [node, python, go, java]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bootstrap assert library
run: |
source lib/assert.sh
assert_exists lib/assert.sh
# --- Node: npm cache needs package-lock.json ------------------------
- name: Setup Node
if: matrix.tool == 'node'
id: setup-node
continue-on-error: true
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Assert Node
if: matrix.tool == 'node'
run: |
source lib/assert.sh
echo "node cache-hit=${{ steps.setup-node.outputs.cache-hit }}"
if [ "${{ steps.setup-node.outcome }}" != "success" ]; then
echo "::warning::setup-node failed (TLS/network). Node version NOT verified."
elif ! command -v node >/dev/null 2>&1; then
echo "SKIP: node not installed"
else
assert_match "$(node -v)" "^v20" "node version"
fi
# --- Python: pip cache needs requirements.txt -----------------------
- name: Setup Python
if: matrix.tool == 'python'
id: setup-python
continue-on-error: true
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Assert Python
if: matrix.tool == 'python'
run: |
source lib/assert.sh
if [ "${{ steps.setup-python.outcome }}" != "success" ]; then
echo "::warning::setup-python failed (TLS/network). Python version NOT verified."
elif ! command -v python3 >/dev/null 2>&1; then
echo "SKIP: python not installed"
else
assert_match "$(python3 --version 2>&1)" "3.12" "python version"
fi
# --- Go: cache:true auto-detects go.mod/go.sum ----------------------
- name: Setup Go
if: matrix.tool == 'go'
id: setup-go
continue-on-error: true
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Assert Go
if: matrix.tool == 'go'
run: |
source lib/assert.sh
if [ "${{ steps.setup-go.outcome }}" != "success" ]; then
echo "::warning::setup-go failed (TLS/network). Go version NOT verified."
elif ! command -v go >/dev/null 2>&1; then
echo "SKIP: go not installed"
else
assert_match "$(go version)" "go1.22" "go version"
fi
# --- Java: Temurin, Maven cache needs pom.xml -----------------------
- name: Setup Java
if: matrix.tool == 'java'
id: setup-java
continue-on-error: true
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Assert Java
if: matrix.tool == 'java'
run: |
source lib/assert.sh
if [ "${{ steps.setup-java.outcome }}" != "success" ]; then
echo "::warning::setup-java failed (TLS/network). Java version NOT verified."
elif ! command -v java >/dev/null 2>&1; then
echo "SKIP: java not installed"
else
assert_match "$(java -version 2>&1)" "21" "java version"
fi