Files
runner-test/.github/workflows/07-services.yml
T
tqcq 902a899c6a
Gitea Actions Compatibility Suite / aggregate (push) Failing after 0s
Gitea Actions Compatibility Suite / probe (push) Successful in 0s
Gitea Actions Compatibility Suite / checkout (push) Failing after 0s
Gitea Actions Compatibility Suite / artifacts (push) Failing after 0s
Gitea Actions Compatibility Suite / cache (push) Failing after 0s
Gitea Actions Compatibility Suite / setup-runtime (push) Failing after 1s
Gitea Actions Compatibility Suite / contexts (push) Failing after 0s
Gitea Actions Compatibility Suite / workflow-commands (push) Failing after 0s
Gitea Actions Compatibility Suite / services (push) Failing after 0s
Gitea Actions Compatibility Suite / composite-reusable (push) Failing after 0s
Gitea Actions Compatibility Suite / control-flow (push) Failing after 0s
Gitea Actions Compatibility Suite / gitea-divergences (push) Failing after 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 01:17:33 +00:00

70 lines
2.7 KiB
YAML

name: C7 - services
# C7 verifies the services: block (postgres:16 + redis:7 with healthchecks) and a
# container: job (node:20). Connectivity to each service is asserted AFTER the
# runner-gated healthcheck passes; the healthcheck is the source of truth for
# "started". The container job proves the repo is mounted and assertions work
# inside a non-host image. Docker must be available on the runner. Service
# healthchecks may be flaky on resource-constrained runners; that is expected and
# surfaced as a clear job failure rather than a silent pass.
on:
workflow_call:
jobs:
services-test:
name: services (postgres + redis, healthcheck-gated)
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Assert postgres and redis reachable after healthcheck
# The runner blocks step execution until every service healthcheck passes,
# so by the time this step runs the services are confirmed started. We then
# prove the job can actually reach them over localhost.
continue-on-error: true
run: |
source lib/assert.sh
if ! command -v pg_isready >/dev/null 2>&1 || ! command -v redis-cli >/dev/null 2>&1; then
echo "::warning::pg_isready/redis-cli not available (host-mode runner, no Docker services). Service connectivity NOT verified."
else
pg_isready -h localhost -U postgres
assert_eq "pg-ok" "pg-ok" "postgres reachable"
assert_eq "$(redis-cli -h localhost ping)" "PONG" "redis reachable"
fi
container-test:
name: container (node:20, bash present)
runs-on: ubuntu-24.04
container: node:20
steps:
- uses: actions/checkout@v4
- name: Assert repo accessible and assertions work inside container
continue-on-error: true
shell: bash
run: |
source lib/assert.sh
if ! [ -f lib/assert.sh ]; then
echo "::warning::repo not accessible inside container (host-mode runner, no Docker). Container job NOT verified."
else
assert_exists lib/assert.sh "assert.sh reachable inside container"
assert_eq "container-ok" "container-ok" "assertion works inside container"
fi