From 1812e8c1e81e9e01741819e3a51b1b825f99b485 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 11 Feb 2025 20:06:27 +0100 Subject: [PATCH 1/9] Update playwright.yml --- .github/workflows/playwright.yml | 33 ++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 092b6f3f..30455639 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -29,19 +29,32 @@ jobs: - name: Create .env file run: | + missing=false + check_secret() { + if [ -z "${{ secrets.$1 }}" ]; then + echo "❌ Error: Missing secret $1" + missing=true + fi + } + + # Check all required secrets + check_secret VUE_APP_FIREBASE_API_KEY + + if [ "$missing" = true ]; then + echo "⛔ Missing required environment variables. Exiting..." + exit 1 + fi + + # If all secrets exist, create the .env file cat << EOF > .env VUE_APP_FIREBASE_API_KEY=${{ secrets.VUE_APP_FIREBASE_API_KEY }} - VUE_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }} - VUE_APP_FIREBASE_PROJECT_ID=${{ secrets.VUE_APP_FIREBASE_PROJECT_ID }} - VUE_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }} - VUE_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }} - VUE_APP_FIREBASE_APP_ID=${{ secrets.VUE_APP_FIREBASE_APP_ID }} - - VUE_APP_USE_FIREBASE_EMULATOR=true - VUE_APP_FIREBASE_AUTH_EMULATOR_URL=http://localhost:9099 - VUE_APP_FIREBASE_FIRESTORE_EMULATOR_HOST=localhost:8081 + EOF + + - name: Debug .env file + run: cat .env + - name: Build and start services run: docker-compose up -d --build @@ -70,4 +83,4 @@ jobs: retention-days: 30 - name: Stop services - run: docker-compose down \ No newline at end of file + run: docker-compose down From c64e19d33c1a9503010e3e6131ddaac0ac01e7f3 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 11 Feb 2025 20:12:27 +0100 Subject: [PATCH 2/9] Update playwright.yml --- .github/workflows/playwright.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 30455639..3f3103fc 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -26,20 +26,18 @@ jobs: - name: Install Docker Compose run: sudo apt-get update && sudo apt-get install docker-compose - + - name: Create .env file run: | missing=false - check_secret() { - if [ -z "${{ secrets.$1 }}" ]; then - echo "❌ Error: Missing secret $1" - missing=true - fi - } - # Check all required secrets - check_secret VUE_APP_FIREBASE_API_KEY + # Check each secret explicitly + if [ -z "${{ secrets.VUE_APP_FIREBASE_API_KEY }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_API_KEY" + missing=true + fi + # Exit if any secrets are missing if [ "$missing" = true ]; then echo "⛔ Missing required environment variables. Exiting..." exit 1 @@ -48,7 +46,6 @@ jobs: # If all secrets exist, create the .env file cat << EOF > .env VUE_APP_FIREBASE_API_KEY=${{ secrets.VUE_APP_FIREBASE_API_KEY }} - EOF From 9e83543af1a86245423651f602fa148b688ca265 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 11 Feb 2025 20:14:05 +0100 Subject: [PATCH 3/9] Update playwright.yml --- .github/workflows/playwright.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 3f3103fc..3b09f584 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -36,6 +36,10 @@ jobs: echo "❌ Error: Missing secret VUE_APP_FIREBASE_API_KEY" missing=true fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_AUTH_DOMAIN" + missing=true + fi # Exit if any secrets are missing if [ "$missing" = true ]; then From ff0101b5a635601276ce7dcc1970703be3515239 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Feb 2025 10:06:31 +0100 Subject: [PATCH 4/9] Update playwright.yml --- .github/workflows/playwright.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 3b09f584..4b7c8774 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -55,33 +55,3 @@ jobs: - name: Debug .env file run: cat .env - - - name: Build and start services - run: docker-compose up -d --build - - - name: Wait for container to become available - run: | - npx wait-on http://localhost:8080 - sleep 30 # Increase additional wait time to ensure the server is ready - - - name: Check Docker logs - run: docker-compose logs - - - name: Install npm dependencies - run: npm ci - - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - - name: Run Playwright tests - run: npx playwright test - - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 - - - name: Stop services - run: docker-compose down From 74666bf791609a1b63227eb4a3e47e7e105f6498 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Feb 2025 10:13:47 +0100 Subject: [PATCH 5/9] Update playwright.yml --- .github/workflows/playwright.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 4b7c8774..e26ecb33 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -50,6 +50,7 @@ jobs: # If all secrets exist, create the .env file cat << EOF > .env VUE_APP_FIREBASE_API_KEY=${{ secrets.VUE_APP_FIREBASE_API_KEY }} + VUE_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }} EOF From 108e400c9b58d4f2c7a0dd0d9be25e041477a2f7 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Feb 2025 15:50:48 +0100 Subject: [PATCH 6/9] Update playwright.yml --- .github/workflows/playwright.yml | 45 +++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index e26ecb33..c89d820e 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -30,8 +30,7 @@ jobs: - name: Create .env file run: | missing=false - - # Check each secret explicitly + if [ -z "${{ secrets.VUE_APP_FIREBASE_API_KEY }}" ]; then echo "❌ Error: Missing secret VUE_APP_FIREBASE_API_KEY" missing=true @@ -40,19 +39,45 @@ jobs: echo "❌ Error: Missing secret VUE_APP_FIREBASE_AUTH_DOMAIN" missing=true fi - - # Exit if any secrets are missing + if [ -z "${{ secrets.VUE_APP_FIREBASE_PROJECT_ID }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_PROJECT_ID" + missing=true + fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_STORAGE_BUCKET" + missing=true + fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_MESSAGING_SENDER_ID" + missing=true + fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_APP_ID }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_APP_ID" + missing=true + fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_MEASUREMENT_ID }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_MEASUREMENT_ID" + missing=true + fi + + + # Exit if any required secret is missing if [ "$missing" = true ]; then echo "⛔ Missing required environment variables. Exiting..." exit 1 fi - - # If all secrets exist, create the .env file - cat << EOF > .env - VUE_APP_FIREBASE_API_KEY=${{ secrets.VUE_APP_FIREBASE_API_KEY }} - VUE_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }} + + # Create the .env file + echo "Creating .env file..." + cat > .env < Date: Wed, 12 Feb 2025 16:19:15 +0100 Subject: [PATCH 7/9] Update playwright.yml --- .github/workflows/playwright.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c89d820e..bf422ff5 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -55,10 +55,6 @@ jobs: echo "❌ Error: Missing secret VUE_APP_FIREBASE_APP_ID" missing=true fi - if [ -z "${{ secrets.VUE_APP_FIREBASE_MEASUREMENT_ID }}" ]; then - echo "❌ Error: Missing secret VUE_APP_FIREBASE_MEASUREMENT_ID" - missing=true - fi # Exit if any required secret is missing @@ -76,7 +72,6 @@ jobs: VUE_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }} VUE_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }} VUE_APP_FIREBASE_APP_ID=${{ secrets.VUE_APP_FIREBASE_APP_ID }} - VUE_APP_FIREBASE_MEASUREMENT_ID=${{ secrets.VUE_APP_FIREBASE_MEASUREMENT_ID }} EOF - name: Debug .env file From 9a30905c0072dac198ebba46a9ea7c365f50ee97 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Feb 2025 16:33:28 +0100 Subject: [PATCH 8/9] Update playwright.yml --- .github/workflows/playwright.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index bf422ff5..29f33715 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -55,6 +55,10 @@ jobs: echo "❌ Error: Missing secret VUE_APP_FIREBASE_APP_ID" missing=true fi + if [ -z "${{ secrets.VUE_APP_FIREBASE_DB_URL }}" ]; then + echo "❌ Error: Missing secret VUE_APP_FIREBASE_DB_URL" + missing=true + fi # Exit if any required secret is missing @@ -72,6 +76,7 @@ jobs: VUE_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.VUE_APP_FIREBASE_STORAGE_BUCKET }} VUE_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }} VUE_APP_FIREBASE_APP_ID=${{ secrets.VUE_APP_FIREBASE_APP_ID }} + VUE_APP_FIREBASE_DB_URL=${{secrets.VUE_APP_FIREBASE_DB_URL}} EOF - name: Debug .env file From d6fb5610db11302a7cb2224035cc2bda16e0710f Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Feb 2025 16:37:45 +0100 Subject: [PATCH 9/9] Update playwright.yml --- .github/workflows/playwright.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 29f33715..65fa38d9 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -81,3 +81,33 @@ jobs: - name: Debug .env file run: cat .env + + - name: Build and start services + run: docker-compose up -d --build + + - name: Wait for container to become available + run: | + npx wait-on http://localhost:8080 + sleep 30 # Increase additional wait time to ensure the server is ready + + - name: Check Docker logs + run: docker-compose logs + + - name: Install npm dependencies + run: npm ci + + - name: Install Playwright Browsers + run: npx playwright install --with-deps + + - name: Run Playwright tests + run: npx playwright test + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + - name: Stop services + run: docker-compose down