Skip to content

Commit

Permalink
Add build for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMilek committed Nov 20, 2024
1 parent acf0896 commit 4e289e9
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]

Expand All @@ -32,6 +34,7 @@ jobs:
php: "8.1"
symfony: "^6.4"
sylius: "~1.14.0"
database: "mysql"
mysql: "8.4"
node: "20.x"
wkhtmltopdf: "0.12.6-1"
Expand All @@ -40,6 +43,7 @@ jobs:
php: "8.2"
symfony: "^6.4"
sylius: "~1.14.0"
database: "mysql"
mysql: "8.4"
node: "20.x"
wkhtmltopdf: "0.12.6-1"
Expand All @@ -48,14 +52,15 @@ jobs:
php: "8.2"
symfony: "^6.4"
sylius: "~1.14.0"
mysql: "8.4"
database: "postgres"
postgres: "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:
Expand All @@ -78,15 +83,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
Expand Down

0 comments on commit 4e289e9

Please sign in to comment.