From d2b0233b40a3b82fdf069909b9d37b98ed931ace Mon Sep 17 00:00:00 2001 From: Jorick Schram Date: Mon, 16 Dec 2024 15:50:42 +0100 Subject: [PATCH] Fix Tests in Github Workflow --- .env.testing.example | 10 ++++++++ .github/workflows/continuous-integration.yaml | 23 +++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.env.testing.example b/.env.testing.example index 3ad5f53..6c9cbb4 100644 --- a/.env.testing.example +++ b/.env.testing.example @@ -21,3 +21,13 @@ TELESCOPE_ENABLED=false SURFCONEXT_ROLE_TEACHER=urn:collab:group:test.surfconext.nl:nl:surfnet:diensten:edutools_test_docent SURFCONEXT_ROLE_INFORMATION_MANAGER=urn:collab:group:test.surfconext.nl:nl:surfnet:diensten:edutools_test_informatiemanager SURFCONEXT_ROLE_CONTENT_MANAGER=urn:collab:group:test.surfconext.nl:nl:surfnet:diensten:edutools_test_contentmanager + +AWS_ACCESS_KEY_ID=application +AWS_SECRET_ACCESS_KEY=password +AWS_DEFAULT_REGION=none +AWS_BUCKET_PUBLIC=sreapp-public +AWS_BUCKET=sreapp-public +AWS_URL='http://127.0.0.1:9000/sreapp' +AWS_URL_PUBLIC='http://127.0.0.1:9000/sreapp-public' +AWS_ENDPOINT=http://127.0.0.1:9000/ +AWS_USE_PATH_STYLE_ENDPOINT='true' diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 2fdd406..81d62bd 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -109,6 +109,19 @@ jobs: sudo systemctl start mysql mysql --user="root" --password="root" -e "CREATE DATABASE tests_db character set UTF8mb4 collate utf8mb4_bin;" + - name: Setup minio + run: | + docker run -d -p 9000:9000 --name minio \ + -e "MINIO_ACCESS_KEY=application" \ + -e "MINIO_SECRET_KEY=password" \ + -v /tmp/data:/data \ + -v /tmp/config:/root/.minio \ + minio/minio server /data + export AWS_ACCESS_KEY_ID=application + export AWS_SECRET_ACCESS_KEY=password + export AWS_EC2_METADATA_DISABLED=true + aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://sreapp-public + - name: Set Up PHP and Tools uses: shivammathur/setup-php@master with: @@ -134,15 +147,7 @@ jobs: - name: Build Assets run: ./buildHook.sh $PWD - - name: Run PHPUnit Tests - run: composer test - env: - DB_HOST: localhost - DB_DATABASE: tests_db - DB_USERNAME: root - DB_PASSWORD: root - - - name: Run Test Coverage Report + - name: Run Test & Coverage Report run: ./vendor/bin/phpunit --coverage-clover ./coverage.xml env: DB_HOST: localhost