From 2ee44c391ad245ae3eb8d82a3e2b8ba6821ec304 Mon Sep 17 00:00:00 2001 From: ethangardner Date: Mon, 8 Jul 2024 09:28:55 -0400 Subject: [PATCH] simplify end to end tests --- .../{post-deploy.yml => _end-to-end.yml} | 10 ++--- .github/workflows/_playwright.yml | 39 ------------------- .github/workflows/run-tests.yml | 3 +- 3 files changed, 4 insertions(+), 48 deletions(-) rename .github/workflows/{post-deploy.yml => _end-to-end.yml} (67%) delete mode 100644 .github/workflows/_playwright.yml diff --git a/.github/workflows/post-deploy.yml b/.github/workflows/_end-to-end.yml similarity index 67% rename from .github/workflows/post-deploy.yml rename to .github/workflows/_end-to-end.yml index b89a87e3b..fcf1c22f4 100644 --- a/.github/workflows/post-deploy.yml +++ b/.github/workflows/_end-to-end.yml @@ -1,12 +1,8 @@ -name: 'Post-deploy' +name: End-to-end tests on: - deployment_status: - workflow_dispatch: - push: - branches: - - "106-playwright-storybook" + workflow_call: jobs: - test: + end-to-end: timeout-minutes: 60 runs-on: ubuntu-latest steps: diff --git a/.github/workflows/_playwright.yml b/.github/workflows/_playwright.yml deleted file mode 100644 index f3a13ccc9..000000000 --- a/.github/workflows/_playwright.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Playwright Tests -on: - workflow_call: -jobs: - end_to_end: - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: npm install -g pnpm && pnpm install - - name: Install Playwright Browsers - run: pnpm --filter=end-to-end-tests exec playwright install --with-deps - - name: Debugging steps - run: | - echo "Workflow triggered in branch '${{ github.ref }}'." - echo "Workflow triggered in head_ref '${{ github.head_ref }}'." - echo "Workflow triggered by event '${{ github.event_name }}'." - echo "Workflow triggered by actor '${{ github.actor }}''." - - name: Determine E2E_ENDPOINT - run: > - echo E2E_ENDPOINT=$(if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.head_ref }}" != "main" ]]; then - echo "${{ vars.PREVIEW_URL }}/${{ github.head_ref }}"; - else - echo "${{ vars.MAIN_URL }}"; - fi) >> $GITHUB_ENV - - name: Run Playwright tests - run: pnpm --filter=end-to-end-tests exec playwright test - env: - E2E_ENDPOINT: ${{ env.E2E_ENDPOINT }} - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5eb628228..637429219 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,6 +10,5 @@ jobs: run-tests: uses: ./.github/workflows/_validate.yml e2e: - needs: [run-tests] - uses: ./.github/workflows/_playwright.yml + uses: ./.github/workflows/_end-to-end.yml secrets: inherit \ No newline at end of file