From d8831512d42464888d255169e6436d6713e06631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Fri, 8 Nov 2024 12:24:22 +0100 Subject: [PATCH] Add CI timeouts and enable playwright (#8405) --- .github/workflows/cd-deploy-main.yaml | 1 + .github/workflows/cd-deploy-tag.yaml | 1 + .github/workflows/ci-chrome-extension.yaml | 1 + .../{playwright.yml.bak => ci-e2e.yml.bak} | 35 ++++++++++++------- .github/workflows/ci-front.yaml | 3 +- .github/workflows/ci-release-create.yaml | 1 + .github/workflows/ci-release-merge.yaml | 1 + .github/workflows/ci-server.yaml | 1 + .github/workflows/ci-test-docker-compose.yaml | 1 + .github/workflows/ci-tinybird.yaml | 1 + .github/workflows/ci-utils.yaml | 1 + .github/workflows/ci-website.yaml | 1 + 12 files changed, 33 insertions(+), 15 deletions(-) rename .github/workflows/{playwright.yml.bak => ci-e2e.yml.bak} (59%) diff --git a/.github/workflows/cd-deploy-main.yaml b/.github/workflows/cd-deploy-main.yaml index 9b6217c5a..dc9a031cc 100644 --- a/.github/workflows/cd-deploy-main.yaml +++ b/.github/workflows/cd-deploy-main.yaml @@ -1,4 +1,5 @@ name: CD deploy main +timeout-minutes: 3 on: push: branches: diff --git a/.github/workflows/cd-deploy-tag.yaml b/.github/workflows/cd-deploy-tag.yaml index 17bee3d1a..86c8834a3 100644 --- a/.github/workflows/cd-deploy-tag.yaml +++ b/.github/workflows/cd-deploy-tag.yaml @@ -1,4 +1,5 @@ name: CD deploy tag +timeout-minutes: 3 on: push: tags: diff --git a/.github/workflows/ci-chrome-extension.yaml b/.github/workflows/ci-chrome-extension.yaml index 6f99f922a..5becb944e 100644 --- a/.github/workflows/ci-chrome-extension.yaml +++ b/.github/workflows/ci-chrome-extension.yaml @@ -1,4 +1,5 @@ name: CI Chrome Extension +timeout-minutes: 15 on: push: branches: diff --git a/.github/workflows/playwright.yml.bak b/.github/workflows/ci-e2e.yml.bak similarity index 59% rename from .github/workflows/playwright.yml.bak rename to .github/workflows/ci-e2e.yml.bak index fc45955bc..874872255 100644 --- a/.github/workflows/playwright.yml.bak +++ b/.github/workflows/ci-e2e.yml.bak @@ -1,34 +1,43 @@ -name: Playwright Tests +name: CI E2E Tests +timeout-minutes: 30 on: push: - branches: [ main, master ] + branches: + - main pull_request: - branches: [ main, master ] + branches: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: - timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: lts/* - name: Check for changed files - id: changed-files - uses: tj-actions/changed-files@v11 - with: - files: | - packages/** # Adjust this to your relevant directories - playwright.config.ts # Include any relevant config files + id: changed-files + uses: tj-actions/changed-files@v11 + with: + files: | + packages/** + playwright.config.ts - name: Skip if no relevant changes - if: steps.changed-files.outputs.any_changed != 'true' - run: echo "No relevant changes detected. Marking as valid." + if: steps.changed-files.outputs.any_changed == 'false' + run: echo "No relevant changes detected. Marking as valid." - name: Install dependencies if: steps.changed-files.outputs.any_changed == 'true' - run: npm install -g yarn && yarn + uses: ./.github/workflows/actions/yarn-install - name: Install Playwright Browsers if: steps.changed-files.outputs.any_changed == 'true' run: yarn playwright install --with-deps diff --git a/.github/workflows/ci-front.yaml b/.github/workflows/ci-front.yaml index 1aed46afe..d683c254f 100644 --- a/.github/workflows/ci-front.yaml +++ b/.github/workflows/ci-front.yaml @@ -1,4 +1,5 @@ name: CI Front +timeout-minutes: 30 on: push: branches: @@ -59,7 +60,6 @@ jobs: run: npx nx storybook:build twenty-front front-sb-test: runs-on: shipfox-8vcpu-ubuntu-2204 - timeout-minutes: 60 needs: front-sb-build strategy: matrix: @@ -102,7 +102,6 @@ jobs: run: npx nx storybook:serve-and-test:static twenty-front --configuration=${{ matrix.storybook_scope }} front-sb-test-performance: runs-on: shipfox-8vcpu-ubuntu-2204 - timeout-minutes: 60 env: REACT_APP_SERVER_BASE_URL: http://localhost:3000 NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 diff --git a/.github/workflows/ci-release-create.yaml b/.github/workflows/ci-release-create.yaml index 068d054cb..e11a3d177 100644 --- a/.github/workflows/ci-release-create.yaml +++ b/.github/workflows/ci-release-create.yaml @@ -1,4 +1,5 @@ name: "Release: create" +timeout-minutes: 10 on: workflow_dispatch: inputs: diff --git a/.github/workflows/ci-release-merge.yaml b/.github/workflows/ci-release-merge.yaml index 96b719318..14458946c 100644 --- a/.github/workflows/ci-release-merge.yaml +++ b/.github/workflows/ci-release-merge.yaml @@ -1,4 +1,5 @@ name: "Release: on merge" +timeout-minutes: 10 on: pull_request: types: diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yaml index b4fb89e4d..bce6d14bc 100644 --- a/.github/workflows/ci-server.yaml +++ b/.github/workflows/ci-server.yaml @@ -1,4 +1,5 @@ name: CI Server +timeout-minutes: 30 on: push: branches: diff --git a/.github/workflows/ci-test-docker-compose.yaml b/.github/workflows/ci-test-docker-compose.yaml index 50277ab7a..ad3f37e55 100644 --- a/.github/workflows/ci-test-docker-compose.yaml +++ b/.github/workflows/ci-test-docker-compose.yaml @@ -1,4 +1,5 @@ name: 'Test Docker Compose' +timeout-minutes: 10 on: pull_request: diff --git a/.github/workflows/ci-tinybird.yaml b/.github/workflows/ci-tinybird.yaml index 8a83f3e81..8233e8a40 100644 --- a/.github/workflows/ci-tinybird.yaml +++ b/.github/workflows/ci-tinybird.yaml @@ -1,4 +1,5 @@ name: CI Tinybird +timeout-minutes: 10 on: push: branches: diff --git a/.github/workflows/ci-utils.yaml b/.github/workflows/ci-utils.yaml index fccfca98d..93e5ddac2 100644 --- a/.github/workflows/ci-utils.yaml +++ b/.github/workflows/ci-utils.yaml @@ -1,4 +1,5 @@ name: CI Utils +timeout-minutes: 3 on: # it's usually not recommended to use pull_request_target # but we consider it's safe here if we keep the same steps diff --git a/.github/workflows/ci-website.yaml b/.github/workflows/ci-website.yaml index 1b015c2a3..e38d1fd93 100644 --- a/.github/workflows/ci-website.yaml +++ b/.github/workflows/ci-website.yaml @@ -1,4 +1,5 @@ name: CI Website +timeout-minutes: 10 on: push: branches: