From 09f804413b746906c2e18307ad37d83607d9ad0b Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Mon, 18 Dec 2023 12:48:55 -0500 Subject: [PATCH] chore: Moved e2e suite to run on pushes to main (#12819) * chore: Moved e2e suite to run on pushes to main * Update yarn.lock * Small cleanup * Moved production build without database to pre-release * Added name to script * Added changes, lint and build dependencies --- .github/workflows/e2e-app-store.yml | 2 +- .github/workflows/e2e-embed-react.yml | 2 +- .github/workflows/e2e-embed.yml | 2 +- .github/workflows/e2e.yml | 2 +- .github/workflows/pr.yml | 62 +------------- .github/workflows/pre-release.yml | 85 +++++++++++++++++++ .../workflows/{test.yml => unit-tests.yml} | 0 7 files changed, 91 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/pre-release.yml rename .github/workflows/{test.yml => unit-tests.yml} (100%) diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml index 90d725d96d..471b0357e3 100644 --- a/.github/workflows/e2e-app-store.yml +++ b/.github/workflows/e2e-app-store.yml @@ -1,4 +1,4 @@ -name: E2E App-Store Apps +name: E2E App-Store Apps Tests on: workflow_call: diff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.yml index 5b356246c7..040dec0265 100644 --- a/.github/workflows/e2e-embed-react.yml +++ b/.github/workflows/e2e-embed-react.yml @@ -1,4 +1,4 @@ -name: E2E Embed React tests and booking flow(for non-embed as well) +name: E2E Embed React tests and booking flow (for non-embed as well) on: workflow_call: diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml index bed5801813..12be6a8500 100644 --- a/.github/workflows/e2e-embed.yml +++ b/.github/workflows/e2e-embed.yml @@ -1,4 +1,4 @@ -name: E2E Embed Core tests and booking flow(for non-embed as well) +name: E2E Embed Core tests and booking flow (for non-embed as well) on: workflow_call: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index aaa218103b..8570d95786 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,4 @@ -name: E2E test +name: E2E tests on: workflow_call: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c792d008bf..5395b1bd84 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,35 +15,6 @@ concurrency: cancel-in-progress: true jobs: - changes: - name: Detect changes - runs-on: buildjet-4vcpu-ubuntu-2204 - permissions: - pull-requests: read - outputs: - app-store: ${{ steps.filter.outputs.app-store }} - embed: ${{ steps.filter.outputs.embed }} - embed-react: ${{ steps.filter.outputs.embed-react }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/dangerous-git-checkout - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - app-store: - - 'apps/web/**' - - 'packages/app-store/**' - - 'playwright.config.ts' - embed: - - 'apps/web/**' - - 'packages/embeds/**' - - 'playwright.config.ts' - embed-react: - - 'apps/web/**' - - 'packages/embeds/**' - - 'playwright.config.ts' - type-check: name: Type check uses: ./.github/workflows/check-types.yml @@ -51,7 +22,7 @@ jobs: test: name: Unit tests - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/unit-tests.yml secrets: inherit lint: @@ -64,42 +35,13 @@ jobs: uses: ./.github/workflows/production-build.yml secrets: inherit - build-without-database: - name: Production build (without database) - uses: ./.github/workflows/production-build-without-database.yml - secrets: inherit - - e2e: - name: E2E tests - needs: [changes, lint, build] - uses: ./.github/workflows/e2e.yml - secrets: inherit - - e2e-app-store: - name: E2E App Store tests - needs: [changes, lint, build] - uses: ./.github/workflows/e2e-app-store.yml - secrets: inherit - - e2e-embed: - name: E2E embeds tests - needs: [changes, lint, build] - uses: ./.github/workflows/e2e-embed.yml - secrets: inherit - - e2e-embed-react: - name: E2E React embeds tests - needs: [changes, lint, build] - uses: ./.github/workflows/e2e-embed-react.yml - secrets: inherit - analyze: needs: build uses: ./.github/workflows/nextjs-bundle-analysis.yml secrets: inherit required: - needs: [lint, type-check, test, build, e2e, e2e-embed, e2e-embed-react, e2e-app-store] + needs: [lint, type-check, test, build] if: always() runs-on: buildjet-4vcpu-ubuntu-2204 steps: diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000000..90bfbfe383 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,85 @@ +name: Pre-release checks + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + changes: + name: Detect changes + runs-on: buildjet-4vcpu-ubuntu-2204 + permissions: + pull-requests: read + outputs: + app-store: ${{ steps.filter.outputs.app-store }} + embed: ${{ steps.filter.outputs.embed }} + embed-react: ${{ steps.filter.outputs.embed-react }} + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/dangerous-git-checkout + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + app-store: + - 'apps/web/**' + - 'packages/app-store/**' + - 'playwright.config.ts' + embed: + - 'apps/web/**' + - 'packages/embeds/**' + - 'playwright.config.ts' + embed-react: + - 'apps/web/**' + - 'packages/embeds/**' + - 'playwright.config.ts' + + lint: + name: Linters + uses: ./.github/workflows/lint.yml + secrets: inherit + + build: + name: Production build + uses: ./.github/workflows/production-build.yml + secrets: inherit + + e2e-main: + name: E2E tests + needs: [changes, lint, build] + uses: ./.github/workflows/e2e-main.yml + secrets: inherit + + e2e-app-store: + name: E2E App Store tests + needs: [changes, lint, build] + uses: ./.github/workflows/e2e-app-store.yml + secrets: inherit + + e2e-embed: + name: E2E embeds tests + needs: [changes, lint, build] + uses: ./.github/workflows/e2e-embed.yml + secrets: inherit + + e2e-embed-react: + name: E2E React embeds tests + needs: [changes, lint, build] + uses: ./.github/workflows/e2e-embed-react.yml + secrets: inherit + + build-without-database: + name: Production build (without database) + uses: ./.github/workflows/production-build-without-database.yml + secrets: inherit + + required: + needs: [e2e-main, e2e-app-store, e2e-embed, e2e-embed-react, build-without-database] + if: always() + runs-on: buildjet-4vcpu-ubuntu-2204 + steps: + - name: fail if conditional jobs failed + if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') + run: exit 1 diff --git a/.github/workflows/test.yml b/.github/workflows/unit-tests.yml similarity index 100% rename from .github/workflows/test.yml rename to .github/workflows/unit-tests.yml