name: ci
on:
push:
branches: [main]
pull_request:
jobs:
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Go unit tests (race detector)
uses: docker/build-push-action@v6
with:
context: .
target: go-test
cache-from: type=gha,scope=go-test
cache-to: type=gha,scope=go-test,mode=max
php-test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.4", "8.5"]
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: PHP shim tests (fake ABI)
uses: docker/build-push-action@v6
with:
context: .
target: php-test
build-args: PHP_VERSION=${{ matrix.php }}
cache-from: type=gha,scope=php-test-${{ matrix.php }}
cache-to: type=gha,scope=php-test-${{ matrix.php }},mode=max
# Diffs the public surface of a real phpoffice/phpspreadsheet against the
# Compat layer and fails on any new uncovered class/method/constant (gated
# against php/.compat-surface.json). The stage's RUN is the assertion.
compat-surface:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Compat surface gate (vs real PhpSpreadsheet)
uses: docker/build-push-action@v6
with:
context: .
target: compat-surface
cache-from: type=gha,scope=compat-surface
cache-to: type=gha,scope=compat-surface,mode=max
# Compile-verifies the bridge (extension-init + xcaddy against real PHP ZTS
# headers), then runs the end-to-end smoke test inside the built image.
extension-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Build FrankenPHP with easy-excel
uses: docker/build-push-action@v6
with:
context: .
target: runner
load: true
tags: frankenphp-easy-excel:ci
cache-from: type=gha,scope=extension
cache-to: type=gha,scope=extension,mode=max
- name: Smoke test (real extension, full stack)
run: |
docker run --rm -v "$PWD/php:/opt/easy-excel/php" frankenphp-easy-excel:ci \
frankenphp php-cli /opt/easy-excel/php/tests/smoke.php
# the stock Caddyfile must boot (catches missing Caddy modules like the
# br encoder, which php-cli runs never exercise)
- name: Server boot test (stock Caddyfile)
run: |
docker run -d --name boot -e SERVER_NAME=":80" -p 8080:80 frankenphp-easy-excel:ci
for i in $(seq 1 20); do
code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8080 || true)
[ -n "$code" ] && [ "$code" != "000" ] && break
sleep 1
done
docker logs boot
[ "$code" != "000" ] && [ -n "$code" ] || { echo "server never answered"; exit 1; }
docker rm -f boot
govulncheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: extension/go.sum
- run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
cd extension && govulncheck ./registry/... ./limits/... ./exio/... ./compat/... ./core/...
|