From 08515ab3f0e64dea8d051f754bee86c6c0e761d6 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:20:38 +0400 Subject: [PATCH] create `.env` file before running tests --- .github/workflows/test.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d6a09e..867e29a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,14 +30,18 @@ jobs: steps: - uses: actions/checkout@v3 - # - name: Install Ubuntu dependencies - # run: | - # sudo apt-get update - # sudo apt-get install libcurl4-openssl-dev libmysqlclient-dev libgirepository1.0-dev - - name: Import SQL dump to cafe_test database run: mysql -Dcafe_test -uroot -ppassword -h127.0.0.1 -P3306 < "resources/database/dump/cafe.sql" + - name: Create environment file + env: + ENV: | + DB_HOST="127.0.0.1" + DB_USERNAME="root" + DB_PASSWORD="password" + TEST_DB_NAME="cafe_test" + run: echo "$ENV" > src/core/.env + - name: Validate composer.json and composer.lock run: composer validate --strict @@ -53,13 +57,5 @@ jobs: - name: Install Composer dependencies run: composer install --prefer-dist --no-progress - # - name: Start database service - # run: sudo systemctl start mysql.service - - name: Run test suite - env: - DB_HOST: 127.0.0.1 - DB_USERNAME: root - DB_PASSWORD: password - TEST_DB_NAME: cafe_test run: composer test