diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1c3d641..69c8750f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: tests: runs-on: ubuntu-latest - name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ${{ matrix.database == 'mysql' && format('MySQL {0}', matrix.mysql) || matrix.database == 'postgres' && format('Postgres {0}', matrix.postgres) }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" strategy: fail-fast: false @@ -24,6 +24,8 @@ jobs: sylius: ["~1.13.0", "~1.14.0"] mysql: ["8.4"] node: ["20.x"] + postgres: ["15.8"] + database: ["mysql", "postgres"] wkhtmltopdf: ["0.12.6-1"] state_machine_adapter: ["symfony_workflow"] @@ -32,14 +34,25 @@ jobs: php: "8.1" symfony: "^6.4" sylius: "~1.14.0" + database: "mysql" mysql: "8.4" node: "20.x" wkhtmltopdf: "0.12.6-1" state_machine_adapter: "symfony_workflow" + - + php: "8.1" + symfony: "^6.4" + sylius: "~1.14.0" + database: "postgres" + mysql: "15.8" + node: "20.x" + wkhtmltopdf: "0.12.6-1" + state_machine_adapter: "symfony_workflow" - php: "8.2" symfony: "^6.4" sylius: "~1.14.0" + database: "mysql" mysql: "8.4" node: "20.x" wkhtmltopdf: "0.12.6-1" @@ -48,14 +61,33 @@ jobs: php: "8.2" symfony: "^6.4" sylius: "~1.14.0" - mysql: "8.4" + database: "postgres" + mysql: "15.8" + node: "20.x" + wkhtmltopdf: "0.12.6-1" + state_machine_adapter: "winzou_state_machine" + - + php: "8.2" + symfony: "^6.4" + sylius: "~1.14.0" + database: "mysql" + postgres: "8.4" + node: "20.x" + wkhtmltopdf: false + state_machine_adapter: "symfony_workflow" + - + php: "8.2" + symfony: "^6.4" + sylius: "~1.14.0" + database: "postgres" + mysql: "15.8" node: "20.x" wkhtmltopdf: false state_machine_adapter: "symfony_workflow" env: APP_ENV: test - DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" + DATABASE_URL: ${{ matrix.database == 'mysql' && format('mysql://root:root@127.0.0.1/sylius?serverVersion={0}', matrix.mysql) || format('pgsql://postgres:postgres@127.0.0.1/sylius?serverVersion={0}', matrix.postgres) }} TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" steps: @@ -78,15 +110,26 @@ jobs: node-version: "${{ matrix.node }}" - - name: Shutdown default MySQL - run: sudo service mysql stop + name: Shutdown default database services + run: | + sudo service mysql stop || true + sudo service postgresql stop || true - name: Setup MySQL + if: matrix.database == 'mysql' uses: mirromutth/mysql-action@v1.1 with: - mysql version: "${{ matrix.mysql }}" - mysql root password: "root" + mysql version: "${{ matrix.mysql }}" + mysql root password: "root" + + - + name: Setup PostgreSQL + if: matrix.database == 'postgres' + uses: harmon758/postgresql-action@v1 + with: + postgresql version: "${{ matrix.postgres }}" + postgresql password: "postgres" - name: Setup cache for wkhtmltopdf