2026-08-17 13:30:49 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: ['release/*']
|
|
|
|
|
pull_request:
|
|
|
|
|
branches: [main, 'release/*']
|
|
|
|
|
|
|
|
|
|
jobs:
|
2026-08-17 23:13:43 +02:00
|
|
|
ci-image:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
|
|
|
|
image: catthehacker/ubuntu:act-latest
|
|
|
|
|
outputs:
|
|
|
|
|
tag: ${{ steps.meta.outputs.tag }}
|
|
|
|
|
steps:
|
|
|
|
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: https://data.forgejo.org/docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Login to Forgejo Registry
|
|
|
|
|
uses: https://data.forgejo.org/docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
registry: forge.lvl0.xyz
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Compute image tag from lockfile
|
|
|
|
|
id: meta
|
|
|
|
|
run: |
|
|
|
|
|
HASH="$(sha256sum composer.lock | cut -c1-12)"
|
|
|
|
|
echo "tag=php8.3-${HASH}" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
|
|
- name: Build and push CI image
|
|
|
|
|
uses: https://data.forgejo.org/docker/build-push-action@v5
|
|
|
|
|
with:
|
|
|
|
|
context: .
|
|
|
|
|
file: docker/build/Dockerfile.ci
|
|
|
|
|
push: true
|
|
|
|
|
tags: forge.lvl0.xyz/lvl0/dishplanner-ci:${{ steps.meta.outputs.tag }}
|
|
|
|
|
cache-from: type=registry,ref=forge.lvl0.xyz/lvl0/dishplanner-ci:buildcache
|
|
|
|
|
cache-to: type=registry,ref=forge.lvl0.xyz/lvl0/dishplanner-ci:buildcache,mode=max
|
|
|
|
|
|
2026-08-17 13:30:49 +02:00
|
|
|
ci:
|
2026-08-17 23:13:43 +02:00
|
|
|
needs: ci-image
|
2026-08-17 13:30:49 +02:00
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
2026-08-17 23:13:43 +02:00
|
|
|
image: forge.lvl0.xyz/lvl0/dishplanner-ci:${{ needs.ci-image.outputs.tag }}
|
2026-08-17 13:30:49 +02:00
|
|
|
steps:
|
|
|
|
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Prepare environment
|
|
|
|
|
run: cp .env.testing .env
|
|
|
|
|
|
2026-08-17 21:18:01 +02:00
|
|
|
- name: Restore dependencies
|
|
|
|
|
run: |
|
|
|
|
|
cp -a /opt/deps/vendor ./vendor
|
2026-08-17 23:13:43 +02:00
|
|
|
composer install --no-interaction --no-progress
|
2026-08-17 21:18:01 +02:00
|
|
|
|
2026-08-17 13:30:49 +02:00
|
|
|
- name: Lint
|
|
|
|
|
run: vendor/bin/pint --test
|
|
|
|
|
|
|
|
|
|
- name: Static analysis
|
|
|
|
|
run: vendor/bin/phpstan analyse --memory-limit=1G
|
|
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
|
run: php -d memory_limit=512M vendor/bin/phpunit
|