2020-10-14 22:44:46 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2023-07-31 14:21:06 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request: ~
|
|
|
|
workflow_dispatch: ~
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
2020-10-14 22:44:46 +02:00
|
|
|
|
|
|
|
jobs:
|
2023-07-31 14:21:06 +02:00
|
|
|
tests:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-10-26 14:49:28 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-31 14:21:06 +02:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-10-26 14:49:28 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-07-31 14:21:06 +02:00
|
|
|
-
|
|
|
|
name: Build Docker images
|
2023-10-26 14:49:28 +02:00
|
|
|
uses: docker/bake-action@v4
|
2023-07-31 14:21:06 +02:00
|
|
|
with:
|
|
|
|
pull: true
|
|
|
|
load: true
|
|
|
|
files: |
|
2023-10-26 14:49:28 +02:00
|
|
|
compose.yaml
|
|
|
|
compose.override.yaml
|
2023-07-31 14:21:06 +02:00
|
|
|
set: |
|
|
|
|
*.cache-from=type=gha,scope=${{github.ref}}
|
|
|
|
*.cache-from=type=gha,scope=refs/heads/main
|
|
|
|
*.cache-to=type=gha,scope=${{github.ref}},mode=max
|
|
|
|
-
|
|
|
|
name: Start services
|
|
|
|
run: docker compose up --wait --no-build
|
|
|
|
-
|
|
|
|
name: Check HTTP reachability
|
2024-03-06 13:44:55 +01:00
|
|
|
run: curl -v --fail-with-body http://localhost
|
2023-07-31 14:21:06 +02:00
|
|
|
-
|
|
|
|
name: Check HTTPS reachability
|
2024-03-06 13:44:55 +01:00
|
|
|
if: false # Remove this line when the homepage will be configured, or change the path to check
|
|
|
|
run: curl -vk --fail-with-body https://localhost
|
2024-11-18 15:59:53 +02:00
|
|
|
-
|
|
|
|
name: Check Mercure reachability
|
|
|
|
run: curl -vkI --fail-with-body https://localhost/.well-known/mercure?topic=test
|
2023-07-31 14:21:06 +02:00
|
|
|
-
|
|
|
|
name: Create test database
|
|
|
|
if: false # Remove this line if Doctrine ORM is installed
|
|
|
|
run: docker compose exec -T php bin/console -e test doctrine:database:create
|
|
|
|
-
|
|
|
|
name: Run migrations
|
|
|
|
if: false # Remove this line if Doctrine Migrations is installed
|
|
|
|
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
|
|
|
|
-
|
|
|
|
name: Run PHPUnit
|
|
|
|
if: false # Remove this line if PHPUnit is installed
|
|
|
|
run: docker compose exec -T php bin/phpunit
|
|
|
|
-
|
|
|
|
name: Doctrine Schema Validator
|
|
|
|
if: false # Remove this line if Doctrine ORM is installed
|
|
|
|
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
|
|
|
|
lint:
|
|
|
|
name: Docker Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2023-10-26 14:49:28 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-07-31 14:21:06 +02:00
|
|
|
-
|
2023-09-14 14:11:07 +02:00
|
|
|
name: Lint Dockerfile
|
2023-07-31 14:21:06 +02:00
|
|
|
uses: hadolint/hadolint-action@v3.1.0
|