From 98fa0e9f27e82e92cf38c2e3cc3dcf381460166f Mon Sep 17 00:00:00 2001 From: sanjeet-tw <111740060+sanjeet-tw@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:55:59 +0530 Subject: [PATCH] Update ~reusable_e2e_by_OS.yaml --- .github/workflows/~reusable_e2e_by_OS.yaml | 172 ++++++++++++++++++++- 1 file changed, 169 insertions(+), 3 deletions(-) diff --git a/.github/workflows/~reusable_e2e_by_OS.yaml b/.github/workflows/~reusable_e2e_by_OS.yaml index 4a062ce40..2b5f44d8c 100644 --- a/.github/workflows/~reusable_e2e_by_OS.yaml +++ b/.github/workflows/~reusable_e2e_by_OS.yaml @@ -90,13 +90,13 @@ env: NODE_OPTIONS: --max-old-space-size=8192 jobs: - node20: + node18: runs-on: ${{ inputs.OS }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: - node-version: '22' + node-version: '18.17.0' - name: Install project dependencies (Linux) if: ${{ inputs.OS == 'ubuntu-22.04' }} run: | @@ -173,10 +173,176 @@ jobs: with: name: ${{ inputs.OS }}-screenshots path: packages/flex-plugin-e2e-tests/screenshots + node20: + runs-on: ${{ inputs.OS }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20.19.0' + - name: Install project dependencies (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + run: | + echo "Starting npm ci with a 10-minute timeout" + for i in 1 2 3; do # Retry logic, retry 3 times + timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + done + - name: Install project dependencies (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + run: | + echo "Starting npm ci with a 10-minute timeout" + brew install coreutils + for i in 1 2 3; do # Retry logic, retry 3 times + gtimeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + done + - name: Install project dependencies (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + run: | + npm ci --verbose + shell: pwsh + - name: Build packages + run: | + npm run build + - name: Run e2e tests - JS (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - JS (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - JS (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Kill node for Windows os + if: ${{ inputs.OS == 'windows-latest' }} + run: | + echo "os is: ${{ inputs.OS }} ${{ runner.os }}" + taskkill /f /im node.exe + - name: Run e2e tests - TS (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - TS (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - TS (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Upload Screenshots + uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ inputs.OS }}-screenshots + path: packages/flex-plugin-e2e-tests/screenshots + node22: + runs-on: ${{ inputs.OS }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '22' + - name: Install project dependencies (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + run: | + echo "Starting npm ci with a 10-minute timeout" + for i in 1 2 3; do # Retry logic, retry 3 times + timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + done + - name: Install project dependencies (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + run: | + echo "Starting npm ci with a 10-minute timeout" + brew install coreutils + for i in 1 2 3; do # Retry logic, retry 3 times + gtimeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + done + - name: Install project dependencies (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + run: | + npm ci --verbose + shell: pwsh + - name: Build packages + run: | + npm run build + - name: Run e2e tests - JS (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - JS (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - JS (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + env: + TS: 0 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Kill node for Windows os + if: ${{ inputs.OS == 'windows-latest' }} + run: | + echo "os is: ${{ inputs.OS }} ${{ runner.os }}" + taskkill /f /im node.exe + - name: Run e2e tests - TS (Linux) + if: ${{ inputs.OS == 'ubuntu-22.04' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - TS (Macos) + if: ${{ inputs.OS == 'macos-latest' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Run e2e tests - TS (Windows) + if: ${{ inputs.OS == 'windows-latest' }} + env: + TS: 1 + run: | + cd packages/flex-plugin-e2e-tests + npm run start + - name: Upload Screenshots + uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{ inputs.OS }}-screenshots + path: packages/flex-plugin-e2e-tests/screenshots notify-failure: runs-on: ubuntu-22.04 - needs: node20 + needs: [node18, node20, node22] if: ${{ always() && inputs.SEND_NOTIFICATION }} steps: - name: Slack Notification