Author SHA1 Message Date
haylan f3491ef4a6 fix(ci): downgrade actions/upload-artifact and actions/download-artifact to v3 for compatibility
Tests / build-dev (pull_request) Successful in 1m14s
Tests / test (pull_request) Failing after 38s
Tests / build-prod (pull_request) Successful in 4m2s
2026-07-17 12:41:35 +02:00
haylan d6a4f7c41f feat(ci): update Gitea workflow to include registry login and cache handling adjustments
Tests / build-dev (pull_request) Failing after 2m40s
Tests / build-prod (pull_request) Has been skipped
Tests / test (pull_request) Has been skipped
2026-07-17 12:37:12 +02:00
haylan 211edc4538 refactor(ci): reorganize test workflow to streamline Docker image handling
Tests / build-dev (pull_request) Failing after 3m28s
Tests / build-prod (pull_request) Has been skipped
Tests / test (pull_request) Has been skipped
2026-07-17 12:27:41 +02:00
haylan 14b325b3bf refactor(ci): migrate PHP setup to Docker for testing workflow
Tests / test (pull_request) Has been cancelled
Tests / docker-build (pull_request) Has been cancelled
2026-07-17 12:19:39 +02:00
haylan d15e25abf3 Merge branch 'main' into patch-2-gitea-registry
Tests / test (pull_request) Has been cancelled
Tests / docker-build (pull_request) Has been cancelled
2026-07-17 10:09:04 +00:00
haylan 7688fd77c9 Merge pull request 'chore(docker): remove redundant composer dump-env command in build stage' (#16) from patch-2-gitea-registry into main
Reviewed-on: #16
2026-07-13 10:23:14 +00:00
haylan 68424aa28b Merge pull request 'chore(ci/cd): replaced registry url.' (#15) from patch-2-gitea-registry into main
Reviewed-on: #15
2026-07-13 10:11:00 +00:00
2 changed files with 70 additions and 28 deletions
+52 -27
View File
@@ -6,37 +6,48 @@ on:
pull_request:
branches: [main]
env:
REGISTRY: git.arthurerlich.de
jobs:
test:
build-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# type=gha depends on act_runner's internal cache proxy, which is unreachable
# from job containers on this runner (dial tcp ... i/o timeout). Use the
# registry cache backend instead, same as docker-publish.yml.
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
php-version: "8.4"
extensions: intl, zip, opcache
coverage: none
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Cache Composer dependencies
uses: actions/cache@v4
- name: Build dev image (PHP 8.4 + composer deps)
uses: docker/build-push-action@v5
with:
path: ~/.composer/cache
key: composer-${{ hashFiles('composer.lock') }}
restore-keys: composer-
context: .
file: Dockerfile.dev
target: dev
outputs: type=docker,dest=/tmp/graph-dev.tar
tags: graph-dev:ci
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-dev
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-dev,mode=max
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHPUnit
run: vendor/bin/phpunit --testdox
- name: Run PHPStan
run: composer phpstan
docker-build:
- name: Upload dev image
uses: actions/upload-artifact@v3
with:
name: graph-dev-image
path: /tmp/graph-dev.tar
retention-days: 1
build-prod:
needs: build-dev
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -53,10 +64,24 @@ jobs:
target: final
push: false
- name: Build dev image (dev target)
uses: docker/build-push-action@v5
test:
needs: build-dev
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dev image
uses: actions/download-artifact@v3
with:
context: .
file: Dockerfile.dev
target: dev
push: false
name: graph-dev-image
path: /tmp
- name: Load dev image
run: docker load --input /tmp/graph-dev.tar
- name: Run PHPUnit
run: docker run --rm graph-dev:ci vendor/bin/phpunit --testdox
- name: Run PHPStan
run: docker run --rm graph-dev:ci composer phpstan
+17
View File
@@ -138,12 +138,29 @@ Workflow files live in [.gitea/workflows/](.gitea/workflows/). This project uses
- Secrets are set under Repository → Settings → Secrets → Actions
- The registry hostname must be derived from `gitea.server_url` (strip the protocol prefix)
- Triggers use standard `on:` syntax; `tags: '*.*.*'` matches semver pushes without a `v` prefix
- Do not use `cache-from/cache-to: type=gha` — on this instance's act_runner (v2.0.0), the internal GitHub Actions-cache-compatible proxy is not reachable from job containers (`dial tcp <ip>:<port>: i/o timeout`), a known act_runner docker-executor networking limitation, not a workflow bug. Use `type=registry` instead (push cache blobs to `${{ env.REGISTRY }}/<repo>:buildcache*` — see both `test.yml` and `docker-publish.yml`); it requires a registry login step even for jobs that don't push the final image.
**Current workflows:**
| File | Trigger | Purpose |
| -------------------- | ---------------- | --------------------------------------------------------- |
| `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry |
| `test.yml` | Push/PR to `main`| Build dev+prod images, run PHPUnit and PHPStan |
### Release testing with `act`
Before tagging a release (anything that would trigger `docker-publish.yml`), run `test.yml` locally with [`act`](https://github.com/nektos/act) to catch pipeline failures before pushing. `test.yml` uses plain GitHub Actions syntax (no `gitea.*` contexts), so it runs under `act` unmodified.
```bash
act -j test \
-P ubuntu-latest=catthehacker/ubuntu:act-latest \
--artifact-server-path /tmp/act-artifacts
```
- `-P ubuntu-latest=catthehacker/ubuntu:act-latest` — default act runner image lacks a Docker CLI, which the `test` job needs for its nested `docker run` steps
- `--artifact-server-path` — required for the `upload-artifact`/`download-artifact` steps to work; without it they silently no-op
**If `act` is not installed:** warn the user it's missing and how to install it (`sudo pacman -S act`, or see the repo above) — do not install it yourself or force the check. `docker-publish.yml` is out of scope for `act` (it needs real `gitea.*` context and a live registry secret); don't try to run it locally.
## Docker