19 Commits
Author SHA1 Message Date
haylan cfde2ed798 Merge pull request 'feat(release): add workflow for creating release tags and update CHANGELOG.md' (#22) from patch-2-gitea-registry into main
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Reviewed-on: #22
2026-07-31 12:58:05 +00:00
haylan a24bace57a Merge branch 'main' into patch-2-gitea-registry
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / build-dev (pull_request) Successful in 2m14s
Tests / build-prod (pull_request) Successful in 1m59s
2026-07-31 12:53:38 +00:00
haylan 4d479f0166 feat(release): add workflow for creating release tags and update CHANGELOG.md
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / build-dev (pull_request) Successful in 2m14s
Tests / build-prod (pull_request) Successful in 1m59s
2026-07-31 14:52:35 +02:00
haylan b3fa891b89 Merge pull request 'fix(ci): remove local image build step for Trivy scanning' (#21) from patch-2-gitea-registry into main
Tests / build-dev (push) Successful in 1m15s
Tests / build-prod (push) Successful in 1m10s
Reviewed-on: #21
2026-07-31 12:37:47 +00:00
haylan 98bbb7017f fix(ci): remove local image build step for Trivy scanning
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / build-dev (pull_request) Successful in 1m16s
Tests / build-prod (pull_request) Successful in 1m8s
2026-07-31 14:34:43 +02:00
haylan 3b1e78ebf5 Merge pull request 'feat(ci): add GitHub Actions workflow for testing and Docker builds' (#20) from patch-2-gitea-registry into main
Tests / build-dev (push) Successful in 1m11s
Tests / build-prod (push) Successful in 1m7s
Reviewed-on: #20
2026-07-31 12:22:23 +00:00
haylan a8f5680e6e fix(ci): update dev image build process and run tests in the same job
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / build-dev (pull_request) Successful in 1m14s
Tests / build-prod (pull_request) Successful in 3m20s
2026-07-31 14:17:39 +02:00
haylan 658892a639 fix(ci): remove redundant DEV_IMAGE variable and use REGISTRY directly for image tags 2026-07-31 14:07:07 +02:00
haylan 06fc829ff1 fix(ci): update dev image build process and simplify test execution
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / test (push) Skipped
Tests / build-dev (pull_request) Successful in 48s
Tests / test (pull_request) Failing after 1s
Tests / build-prod (pull_request) Successful in 3m38s
2026-07-31 14:02:51 +02:00
haylan 30a2439914 feat(ci): enhance debugging in test workflow with workspace information
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / test (push) Skipped
Tests / build-dev (pull_request) Successful in 1m10s
Tests / test (pull_request) Failing after 29s
Tests / build-prod (pull_request) Successful in 3m23s
2026-07-31 13:46:34 +02:00
haylan 222c8aaa85 fix(ci): correct indentation for loading dev image in test workflow
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / test (push) Skipped
Tests / build-dev (pull_request) Successful in 2m56s
Tests / test (pull_request) Failing after 52s
Tests / build-prod (pull_request) Successful in 3m38s
2026-07-31 10:54:50 +02:00
haylan 47d9a62db7 refactor(ci): streamline test workflow by consolidating test commands and removing unnecessary comments 2026-07-31 08:36:29 +02:00
haylan 0b1fed2f93 fix(ci): add volume mounts for PHPUnit and PHPStan runs in test workflow
Tests / build-dev (push) Skipped
Tests / build-prod (push) Skipped
Tests / test (push) Skipped
Tests / build-dev (pull_request) Successful in 3m1s
Tests / test (pull_request) Failing after 44s
Tests / build-prod (pull_request) Successful in 3m45s
2026-07-30 07:04:53 +02:00
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 53186e9a35 feat(ci): add GitHub Actions workflow for testing and Docker builds
Tests / test (pull_request) Has been cancelled
Tests / docker-build (pull_request) Has been cancelled
2026-07-17 12:07:31 +02:00
6 changed files with 165 additions and 15 deletions
-11
View File
@@ -70,17 +70,6 @@ jobs:
username: ${{ gitea.actor }} username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }} password: ${{ secrets.REGISTRY_TOKEN }}
# Build a single-arch image locally so Trivy can inspect it before the real push.
- name: Build local image for scanning
uses: docker/build-push-action@v5
with:
context: .
target: final
platforms: linux/amd64
load: true
tags: scan-target:${{ inputs.tag }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
+62
View File
@@ -0,0 +1,62 @@
# Cuts a release: moves CHANGELOG.md's [Unreleased] section under a new
# version heading, commits it to main, then creates and pushes the version tag.
# Trigger manually via workflow_dispatch, entering the semver to release.
# The pushed tag can then be built with docker-publish.yml.
name: Create Release Tag
on:
workflow_dispatch:
inputs:
version:
description: "Version to release (semver, e.g. 1.2.3)"
required: true
type: string
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate version and Unreleased section
run: |
if ! [[ "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: '${{ inputs.version }}' is not a valid semver (e.g. 1.2.3)."
exit 1
fi
if git rev-parse "refs/tags/${{ inputs.version }}" >/dev/null 2>&1; then
echo "Error: tag '${{ inputs.version }}' already exists."
exit 1
fi
awk '/^## \[Unreleased\]/{f=1;next}/^## \[/{f=0}f' CHANGELOG.md > /tmp/unreleased.md
if ! grep -q '[^[:space:]]' /tmp/unreleased.md; then
echo "Error: CHANGELOG.md's [Unreleased] section is empty — nothing to release."
exit 1
fi
- name: Move Unreleased entries under the new version heading
run: |
today=$(date +%Y-%m-%d)
awk -v ver="${{ inputs.version }}" -v date="$today" '
/^## \[Unreleased\]/ { print; print ""; print "## [" ver "] - " date; next }
{ print }
' CHANGELOG.md > /tmp/CHANGELOG.md
mv /tmp/CHANGELOG.md CHANGELOG.md
- name: Commit and tag
run: |
git config user.name "gitea-actions"
git config user.email "actions@noreply.git.arthurerlich.de"
git add CHANGELOG.md
git commit -m "chore(release): ${{ inputs.version }}"
git tag "${{ inputs.version }}"
git push origin HEAD:main
git push origin "${{ inputs.version }}"
+78
View File
@@ -0,0 +1,78 @@
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: git.arthurerlich.de
jobs:
build-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build dev image (PHP 8.4 + composer deps)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.dev
target: dev
load: true
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: Run tests in dev image
run: |
cid=$(docker create graph-dev:ci sh -c "
composer install --no-interaction &&
vendor/bin/phpunit --testdox &&
composer phpstan
")
docker cp . "$cid":/app
rc=0
docker start -a "$cid" || rc=$?
docker rm "$cid" > /dev/null
exit $rc
build-prod:
needs: build-dev
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build prod image (final target)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
target: final
push: false
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-prod
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-prod,mode=max
+4
View File
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- Removed a leftover `composer dump-env prod` call in the prod Docker build stage — the command doesn't exist in this project's Composer setup and broke every image build
## [0.2.0] - 2026-07-12 ## [0.2.0] - 2026-07-12
### Added ### Added
+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 - Secrets are set under Repository → Settings → Secrets → Actions
- The registry hostname must be derived from `gitea.server_url` (strip the protocol prefix) - 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 - 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:** **Current workflows:**
| File | Trigger | Purpose | | File | Trigger | Purpose |
| -------------------- | ---------------- | --------------------------------------------------------- | | -------------------- | ---------------- | --------------------------------------------------------- |
| `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry | | `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 ## Docker
Generated
+4 -4
View File
@@ -3322,11 +3322,11 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "2.2.6", "version": "2.2.5",
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/a6e9b5a9420f6109c091e87d82683bd1a80b87ed", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/909c1e5fef7989ac0d0c1c5c42e32a5c4f6198a0",
"reference": "a6e9b5a9420f6109c091e87d82683bd1a80b87ed", "reference": "909c1e5fef7989ac0d0c1c5c42e32a5c4f6198a0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3382,7 +3382,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-07-26T21:22:49+00:00" "time": "2026-07-05T06:31:06+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",