diff --git a/.github/test-postgres-initdb.d/create-ecamp3-test-database.sh b/.github/test-postgres-initdb.d/create-ecamp3-test-database.sh deleted file mode 100755 index 04a2b1b049..0000000000 --- a/.github/test-postgres-initdb.d/create-ecamp3-test-database.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -d postgres <<-EOSQL - CREATE DATABASE "ecamp3test"; - GRANT ALL PRIVILEGES ON DATABASE "ecamp3test" TO $POSTGRES_USER; - CREATE DATABASE "ecamp3test1"; - GRANT ALL PRIVILEGES ON DATABASE "ecamp3test1" TO $POSTGRES_USER; - CREATE DATABASE "ecamp3test2"; - GRANT ALL PRIVILEGES ON DATABASE "ecamp3test2" TO $POSTGRES_USER; -EOSQL diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e79df77d26..0d5ca5d0c2 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -176,6 +176,8 @@ jobs: runs-on: ubuntu-latest env: DATABASE_URL: postgresql://ecamp3:ecamp3@localhost:5432/ecamp3?serverVersion=15&charset=utf8 + POSTGRES_HOST: postgres + POSTGRES_PORT: 5432 services: postgres: @@ -183,8 +185,7 @@ jobs: env: POSTGRES_PASSWORD: 'ecamp3' POSTGRES_USER: 'ecamp3' - volumes: - - ${{ github.workspace }}/.github/test-postgres-initdb.d:/docker-entrypoint-initdb.d + POSTGRES_DB: 'ecamp3test' ports: - '5432:5432' options: >- @@ -230,15 +231,21 @@ jobs: setfacl -dR -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt working-directory: api - - run: php bin/console doctrine:migrations:migrate --no-interaction -e test + - run: | + php bin/console doctrine:database:create --no-interaction -e test + php bin/console doctrine:migrations:migrate --no-interaction -e test working-directory: api - - run: php bin/console doctrine:migrations:migrate --no-interaction -e test + - run: | + php bin/console doctrine:database:create --no-interaction -e test + php bin/console doctrine:migrations:migrate --no-interaction -e test env: TEST_TOKEN: 1 working-directory: api - - run: php bin/console doctrine:migrations:migrate --no-interaction -e test + - run: | + php bin/console doctrine:database:create --no-interaction -e test + php bin/console doctrine:migrations:migrate --no-interaction -e test env: TEST_TOKEN: 2 working-directory: api