From 09cb8b9f947f34cc5c8980d6f5505b4eb77b8a12 Mon Sep 17 00:00:00 2001 From: Jorge Galat Date: Tue, 19 Sep 2023 12:33:48 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20ci:=20publish=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yaml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index ab2b97381..aba78a435 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -1,11 +1,11 @@ on: pull_request: - types: [opened, reopened, synchronize, ready_for_review] - workflow_dispatch: + types: [opened, reopened, synchronize, ready_for_review, closed] jobs: check: runs-on: ubuntu-latest + if: ${{ contains('opened reopened synchronize ready_for_review', github.event.action) && !github.event.pull_request.merged }} environment: Preview env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} @@ -25,8 +25,8 @@ jobs: e2e: needs: [check] - if: github.event_name != 'pull_request' || !github.event.pull_request.draft - timeout-minutes: 60 + if: ${{ !github.event.pull_request.draft && github.event.action != 'closed' }} + timeout-minutes: 30 runs-on: ubuntu-latest environment: Test env: @@ -66,7 +66,7 @@ jobs: e2e-report: needs: [e2e] - if: ${{ always() && needs.e2e.result == 'success' }} + if: ${{ !cancelled() && !github.event.pull_request.draft && !github.event.pull_request.merged }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -81,6 +81,22 @@ jobs: - run: npx playwright merge-reports --reporter html ./blob-reports - uses: actions/upload-artifact@v3 with: - name: html-report--attempt-${{ github.run_attempt }} + name: html-report path: playwright-report retention-days: 30 + + e2e-report-publish: + needs: [e2e-report] + if: ${{ always() && github.event.action == 'closed' && github.event.pull_request.merged }} + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: html-report + path: html-report + - uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 569f3c4008862b4cc595f409db748f41 + projectName: app-test + directory: html-report