Skip to content

Github Actions Playwright workflow #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: release/3.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .docker/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ server {
internal;
}

location /vite {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://node:3000;
proxy_http_version 1.1;

# Enable WebSocket support for HMR
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location ~ \.php$ {
return 404;
}
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TRACK_SCREEN_INFO_UPDATE_INTERVAL_SECONDS=300
ADMIN_REJSEPLANEN_APIKEY=
ADMIN_SHOW_SCREEN_STATUS=false
ADMIN_TOUCH_BUTTON_REGIONS=false
ADMIN_LOGIN_METHODS="[]"
ADMIN_LOGIN_METHODS='[{"type":"username-password","enabled":true,"provider":"username-password","label":""}]'
ADMIN_ENHANCED_PREVIEW=false
###< Admin configuration ###

Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/apispec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on: pull_request

name: Api Spec

jobs:
apispec:
runs-on: ubuntu-latest
name: API Specification validation
strategy:
fail-fast: false
matrix:
php: ["8.3"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist

- name: Export specifications (yaml)
run: bin/console api:openapi:export --yaml --output=public/api-spec-v2.yaml --no-interaction

- name: Check for changes in specifications (yaml)
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.yaml

- name: Export specifications (json)
run: bin/console api:openapi:export --output=public/api-spec-v2.json --no-interaction

- name: Check for changes in specifications (json)
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v2.json
5 changes: 2 additions & 3 deletions .github/workflows/composer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
name: Composer

env:
COMPOSE_USER: root
COMPOSE_USER: runner

on:
pull_request:
Expand Down Expand Up @@ -65,5 +65,4 @@ jobs:
- uses: actions/checkout@v4
- run: |
docker network create frontend
docker compose run --rm phpfpm composer install
docker compose run --rm phpfpm composer audit
docker compose run --rm phpfpm composer audit --locked
40 changes: 40 additions & 0 deletions .github/workflows/composer_install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on: pull_request

name: Composer install

jobs:
test-composer-install:
runs-on: ubuntu-latest
env:
COMPOSER_ALLOW_SUPERUSER: 1
strategy:
fail-fast: false
matrix:
php: ["8.3"]
name: Composer install in prod mode (PHP ${{ matrix.php}})
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-

- name: "[prod] Composer install with exported .env variables"
run: |
set -a && source .env && set +a
APP_ENV=prod composer install --no-dev -o
57 changes: 57 additions & 0 deletions .github/workflows/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on: pull_request

name: Doctrine

jobs:
validate-doctrine-shema:
runs-on: ubuntu-latest
env:
DATABASE_URL: mysql://db:[email protected]:3306/db?serverVersion=mariadb-10.5.13
strategy:
fail-fast: false
matrix:
php: ["8.3"]
name: Validate Schema (PHP ${{ matrix.php}})
services:
mariadb:
image: mariadb:10.5.13
env:
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_DATABASE: db
MYSQL_ROOT_PASSWORD: db
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-

- name: "Composer install with exported .env variables"
run: |
set -a && source .env && set +a
APP_ENV=prod composer install --no-dev -o

- name: Run Doctrine Migrations
run: APP_ENV=prod php bin/console doctrine:migrations:migrate --no-interaction

- name: Validate Doctrine schema
run: APP_ENV=prod php bin/console doctrine:schema:validate
2 changes: 1 addition & 1 deletion .github/workflows/php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
name: Symfony PHP

env:
COMPOSE_USER: root
COMPOSE_USER: runner

on:
pull_request:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on: pull_request

name: Test

jobs:
phpunit:
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:lts
ports:
- 3306
env:
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_DATABASE: db_test
MYSQL_ROOT_PASSWORD: password
# https://mariadb.org/mariadb-server-docker-official-images-healthcheck-without-mysqladmin/
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=5s
--health-timeout=2s
--health-retries=3
strategy:
fail-fast: false
matrix:
php: ["8.3"]
name: PHP Unit tests (PHP ${{ matrix.php }})
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
extensions: apcu, ctype, iconv, imagick, json, redis, soap, xmlreader, zip
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ matrix.php }}-composer-

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist

- name: PHP Unit - Test setup
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
DATABASE_URL="mysql://db:[email protected]:$PORT/db_test" composer run test-setup
DATABASE_URL="mysql://db:[email protected]:$PORT/db_test" composer run test
42 changes: 42 additions & 0 deletions .github/workflows/playwright.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on: pull_request

name: Test

env:
COMPOSE_USER: runner

jobs:
frontend-build-and-test:
name: Playwright
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup network
run: docker network create frontend

- name: Composer install
run: |
docker compose run --rm phpfpm composer install

- name: Build assets
run: |
docker compose run --rm node npm install
docker compose run --rm node npm run build

- name: Run playwright
env:
CI: "true"
run: |
docker compose run --rm playwright npx playwright install --with-deps
docker compose run --rm playwright npx playwright test

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
Loading
Loading