Update all non-major dependencies #2218
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Koillection CI | |
on: | |
workflow_dispatch: | |
push: | |
release: | |
jobs: | |
build_docker_ci_container: | |
name: Build Docker CI container | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Container | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile | |
tags: ci-image | |
push: false | |
outputs: type=docker,dest=/tmp/ci-container.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ci-container | |
path: /tmp/ci-container.tar | |
remove_docker_ci_container: | |
name: Remove Docker CI container | |
if: always() | |
runs-on: ubuntu-latest | |
needs: [ build_docker_ci_container, phpunit_mysql, phpunit_mariadb, phpunit_postgres, doctrine_schema_validator ] | |
steps: | |
- uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: ci-container | |
security_checker: | |
name: Security checker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
id: cache-db | |
with: | |
path: ~/.symfony/cache | |
key: db | |
- uses: symfonycorp/security-checker-action@v5 | |
doctrine_schema_validator: | |
name: Doctrine schema validator | |
runs-on: ubuntu-latest | |
needs: [ build_docker_ci_container ] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-container | |
path: /tmp | |
- name: Load image | |
run: docker load --input /tmp/ci-container.tar | |
- name: Run doctrine schema validator | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ci-image | |
run: | | |
bin/console doctrine:schema:validate --skip-sync | |
phpunit_mysql: | |
name: PHPUnit tests with Mysql ${{ matrix.mysql }} | |
runs-on: ubuntu-latest | |
needs: [ build_docker_ci_container ] | |
strategy: | |
matrix: | |
mysql: [ 8 ] | |
services: | |
mysql: | |
image: mysql:${{ matrix.mysql }} | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-container | |
path: /tmp | |
- name: Load image | |
run: docker load --input /tmp/ci-container.tar | |
- name: Run tests | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ci-image | |
options: | | |
--add-host=host.docker.internal:host-gateway | |
run: | | |
sed -i "s|APP_ENV=.*|APP_ENV=test|i" ".env" | |
sed -i "s|APP_DEBUG=.*|APP_DEBUG=1|i" ".env" | |
sed -i "s|APP_SECRET=.*|APP_SECRET=aRandomSecret|i" ".env" | |
sed -i "s|DB_DRIVER=.*|DB_DRIVER=pdo_mysql|i" ".env" | |
sed -i "s|DB_NAME=.*|DB_NAME=koillection|i" ".env" | |
sed -i "s|DB_HOST=.*|DB_HOST=host.docker.internal|i" ".env" | |
sed -i "s|DB_PORT=.*|DB_PORT=3306|i" ".env" | |
sed -i "s|DB_USER=.*|DB_USER=root|i" ".env" | |
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=root|i" ".env" | |
sed -i "s|DB_VERSION=.*|DB_VERSION=${{ matrix.mysql }}|i" ".env" | |
bin/console lexik:jwt:generate-keypair --env=test | |
bin/console doctrine:database:create --env=test | |
bin/console doctrine:migration:migrate --no-interaction --allow-no-migration --env=test | |
php ./vendor/bin/paratest --runner=WrapperRunner | |
phpunit_mariadb: | |
name: PHPUnit tests with MariaDB ${{ matrix.mariadb }} | |
needs: [ build_docker_ci_container ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
mariadb: [ 10 ] | |
services: | |
mysql: | |
image: mariadb:${{ matrix.mariadb }} | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-container | |
path: /tmp | |
- name: Load image | |
run: docker load --input /tmp/ci-container.tar | |
- name: Run tests | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ci-image | |
options: | | |
--add-host=host.docker.internal:host-gateway | |
run: | | |
sed -i "s|APP_DEBUG=.*|APP_DEBUG=1|i" ".env" | |
sed -i "s|APP_SECRET=.*|APP_SECRET=aRandomSecret|i" ".env" | |
sed -i "s|DB_DRIVER=.*|DB_DRIVER=pdo_mysql|i" ".env" | |
sed -i "s|DB_NAME=.*|DB_NAME=koillection|i" ".env" | |
sed -i "s|DB_HOST=.*|DB_HOST=host.docker.internal|i" ".env" | |
sed -i "s|DB_PORT=.*|DB_PORT=3306|i" ".env" | |
sed -i "s|DB_USER=.*|DB_USER=root|i" ".env" | |
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=root|i" ".env" | |
sed -i "s|DB_VERSION=.*|DB_VERSION=${{ matrix.mariadb }}|i" ".env" | |
bin/console lexik:jwt:generate-keypair --env=test | |
bin/console doctrine:database:create --env=test | |
bin/console doctrine:migration:migrate --no-interaction --allow-no-migration --env=test | |
php ./vendor/bin/paratest --runner=WrapperRunner | |
phpunit_postgres: | |
name: PHPUnit tests with Postgres ${{ matrix.postgres }} | |
needs: [ build_docker_ci_container ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
postgres: [ 10, 11, 12, 13, 14, 15, 16 ] | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres }} | |
env: | |
POSTGRES_PASSWORD: root | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ci-container | |
path: /tmp | |
- name: Load image | |
run: docker load --input /tmp/ci-container.tar | |
- name: Run tests | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ci-image | |
options: | | |
--add-host=host.docker.internal:host-gateway | |
run: | | |
sed -i "s|APP_ENV=.*|APP_ENV=test|i" ".env" | |
sed -i "s|APP_DEBUG=.*|APP_DEBUG=1|i" ".env" | |
sed -i "s|APP_SECRET=.*|APP_SECRET=aRandomSecret|i" ".env" | |
sed -i "s|DB_DRIVER=.*|DB_DRIVER=pdo_pgsql|i" ".env" | |
sed -i "s|DB_NAME=.*|DB_NAME=koillection|i" ".env" | |
sed -i "s|DB_HOST=.*|DB_HOST=host.docker.internal|i" ".env" | |
sed -i "s|DB_PORT=.*|DB_PORT=5432|i" ".env" | |
sed -i "s|DB_USER=.*|DB_USER=postgres|i" ".env" | |
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=root|i" ".env" | |
sed -i "s|DB_VERSION=.*|DB_VERSION=${{ matrix.postgres }}|i" ".env" | |
bin/console lexik:jwt:generate-keypair --env=test | |
bin/console doctrine:database:create --env=test | |
bin/console doctrine:migration:migrate --no-interaction --allow-no-migration --env=test | |
php ./vendor/bin/paratest --runner=WrapperRunner |