Files
git-contribution-graph/.gitea/workflows/test.yml
T
haylan 06fc829ff1
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
fix(ci): update dev image build process and simplify test execution
2026-07-31 14:02:51 +02:00

76 lines
1.9 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: git.arthurerlich.de
DEV_IMAGE: git.arthurerlich.de/${{ gitea.repository }}:ci-${{ gitea.sha }}
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 and push dev image (PHP 8.4 + composer deps)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.dev
target: dev
push: true
tags: ${{ env.DEV_IMAGE }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-dev
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ gitea.repository }}:buildcache-dev,mode=max
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: Build prod image (final target)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
target: final
push: false
test:
needs: build-dev
runs-on: ubuntu-latest
container:
image: ${{ env.DEV_IMAGE }}
credentials:
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
run: |
composer install --no-interaction
vendor/bin/phpunit --testdox
composer phpstan