From 501146673cd2fcbe17fae26f00e56ed1389e94bb Mon Sep 17 00:00:00 2001 From: Yehonatan Daniv Date: Mon, 23 Mar 2026 14:15:24 +0200 Subject: [PATCH] Made E2Es default to all; Allow selecting branch in E2Es; Fixed deps install in E2Es; Fixed builds to fail on yarn mutations; --- .github/workflows/ci.yml | 2 +- .github/workflows/interact-e2e.yml | 34 ++++++++++++++++++++++-------- .github/workflows/motion-e2e.yml | 34 ++++++++++++++++++++++-------- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92837260..c70eb010 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Install dependencies env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: NPQ_PKG_MGR=yarn npx npq install + run: NPQ_PKG_MGR=yarn npx npq install --immutable - name: Build run: yarn build diff --git a/.github/workflows/interact-e2e.yml b/.github/workflows/interact-e2e.yml index 9335989a..787b167c 100644 --- a/.github/workflows/interact-e2e.yml +++ b/.github/workflows/interact-e2e.yml @@ -1,8 +1,15 @@ name: Interact E2E Tests on: + push: + branches: + - master workflow_dispatch: inputs: + branch: + type: string + description: Branch to run tests on + default: master browser: type: choice description: Browser to run tests in @@ -11,7 +18,7 @@ on: - firefox - webkit - all - default: webkit + default: all permissions: contents: read @@ -24,13 +31,16 @@ env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: - e2e: + interact-e2e: + name: Interact E2E (${{ github.event.inputs.browser || 'all' }}) runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Checkout repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + ref: ${{ github.event.inputs.branch || github.ref }} - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 @@ -59,7 +69,7 @@ jobs: - name: Install dependencies env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: NPQ_PKG_MGR=yarn npx npq install + run: NPQ_PKG_MGR=yarn npx npq install --immutable - name: Build motion package run: yarn workspace @wix/motion build @@ -72,26 +82,32 @@ jobs: id: playwright-cache with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('packages/interact/package.json') }} + key: ${{ runner.os }}-playwright-${{ github.event.inputs.browser || 'all' }}-${{ hashFiles('packages/interact/package.json') }} restore-keys: | + ${{ runner.os }}-playwright-${{ github.event.inputs.browser || 'all' }}- ${{ runner.os }}-playwright- - - name: Install Playwright browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' + - name: Install Playwright browsers (all) + if: steps.playwright-cache.outputs.cache-hit != 'true' && (github.event.inputs.browser == 'all' || github.event.inputs.browser == '') working-directory: packages/interact run: npx playwright install --with-deps chromium firefox webkit + - name: Install Playwright browsers (selected) + if: steps.playwright-cache.outputs.cache-hit != 'true' && github.event.inputs.browser != 'all' && github.event.inputs.browser != '' + working-directory: packages/interact + run: npx playwright install --with-deps ${{ github.event.inputs.browser }} + - name: Install Playwright system deps if: steps.playwright-cache.outputs.cache-hit == 'true' - run: npx playwright install-deps + run: npx playwright install-deps ${{ github.event.inputs.browser != 'all' && github.event.inputs.browser != '' && github.event.inputs.browser || '' }} - name: Run E2E tests (selected browser) - if: ${{ github.event.inputs.browser != 'all' }} + if: github.event.inputs.browser != 'all' && github.event.inputs.browser != '' working-directory: packages/interact run: npx playwright test --project=${{ github.event.inputs.browser }} - name: Run E2E tests (all browsers) - if: ${{ github.event.inputs.browser == 'all' }} + if: github.event.inputs.browser == 'all' || github.event.inputs.browser == '' working-directory: packages/interact run: npx playwright test diff --git a/.github/workflows/motion-e2e.yml b/.github/workflows/motion-e2e.yml index 6720e3ff..41f07d41 100644 --- a/.github/workflows/motion-e2e.yml +++ b/.github/workflows/motion-e2e.yml @@ -1,8 +1,15 @@ name: Motion E2E Tests on: + push: + branches: + - master workflow_dispatch: inputs: + branch: + type: string + description: Branch to run tests on + default: master browser: type: choice description: Browser to run tests in @@ -11,7 +18,7 @@ on: - firefox - webkit - all - default: webkit + default: all permissions: contents: read @@ -24,13 +31,16 @@ env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: - e2e: + motion-e2e: + name: Motion E2E (${{ github.event.inputs.browser || 'all' }}) runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Checkout repository uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + ref: ${{ github.event.inputs.branch || github.ref }} - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 @@ -59,7 +69,7 @@ jobs: - name: Install dependencies env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: NPQ_PKG_MGR=yarn npx npq install + run: NPQ_PKG_MGR=yarn npx npq install --immutable - name: Build motion package run: yarn workspace @wix/motion build @@ -69,25 +79,31 @@ jobs: id: playwright-cache with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('packages/motion/package.json') }} + key: ${{ runner.os }}-playwright-${{ github.event.inputs.browser || 'all' }}-${{ hashFiles('packages/motion/package.json') }} restore-keys: | + ${{ runner.os }}-playwright-${{ github.event.inputs.browser || 'all' }}- ${{ runner.os }}-playwright- - - name: Install Playwright browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' + - name: Install Playwright browsers (all) + if: steps.playwright-cache.outputs.cache-hit != 'true' && (github.event.inputs.browser == 'all' || github.event.inputs.browser == '') working-directory: packages/motion run: npx playwright install --with-deps chromium firefox webkit + - name: Install Playwright browsers (selected) + if: steps.playwright-cache.outputs.cache-hit != 'true' && github.event.inputs.browser != 'all' && github.event.inputs.browser != '' + working-directory: packages/motion + run: npx playwright install --with-deps ${{ github.event.inputs.browser }} + - name: Install Playwright system deps if: steps.playwright-cache.outputs.cache-hit == 'true' - run: npx playwright install-deps + run: npx playwright install-deps ${{ github.event.inputs.browser != 'all' && github.event.inputs.browser != '' && github.event.inputs.browser || '' }} - name: Run E2E tests (selected browser) - if: ${{ github.event.inputs.browser != 'all' }} + if: github.event.inputs.browser != 'all' && github.event.inputs.browser != '' working-directory: packages/motion run: npx playwright test --project=${{ github.event.inputs.browser }} - name: Run E2E tests (all browsers) - if: ${{ github.event.inputs.browser == 'all' }} + if: github.event.inputs.browser == 'all' || github.event.inputs.browser == '' working-directory: packages/motion run: npx playwright test