Preserve window bounds during macOS updates #48972
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| schedule: | |
| - cron: 0 * * * * # hourly | |
| workflow_call: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: read | |
| jobs: | |
| track-setup: | |
| runs-on: namespace-profile-ubuntu-2-cores | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| repository: kittycad/modeling-app # required for 'workflow_call' | |
| - name: Track setup (snapshots) | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:snapshots | |
| CI_STEP: setup | |
| - name: Track setup (web) | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:web | |
| CI_STEP: setup | |
| - name: Track setup (desktop) | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:desktop | |
| CI_STEP: setup | |
| build-wasm: | |
| needs: [track-setup] | |
| uses: ./.github/workflows/build-wasm.yml | |
| secrets: | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| snapshots: | |
| needs: [build-wasm] | |
| name: e2e:snapshots | |
| runs-on: namespace-profile-macos-8-cores | |
| if: github.repository == 'kittycad/modeling-app' | |
| steps: | |
| - uses: actions/create-github-app-token@v3.2.0 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} | |
| private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| repository: kittycad/modeling-app # required for 'workflow_call' | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-wasm | |
| path: prepared-wasm | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-ts-rs-bindings | |
| path: prepared-ts-rs-bindings | |
| - name: Copy prepared Wasm | |
| run: | | |
| ls -R prepared-wasm | |
| cp prepared-wasm/kcl_wasm_lib_bg.wasm public | |
| mkdir rust/kcl-wasm-lib/pkg | |
| cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg | |
| # build:wasm generates these ignored ts-rs files in rust/kcl-lib/bindings. | |
| # Restore them here because StdLibCommands is imported as a runtime value. | |
| - name: Copy prepared ts-rs bindings | |
| run: | | |
| ls -R prepared-ts-rs-bindings | |
| mkdir rust/kcl-lib/bindings | |
| cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/ | |
| - uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Download browser cache | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright/ | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} | |
| - name: Install browsers | |
| run: npm run playwright install --with-deps | |
| - run: npm run test:snapshots | |
| env: | |
| VITE_ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:snapshots | |
| TARGET: web | |
| - name: Update snapshots | |
| if: failure() | |
| run: npm run test:snapshots -- --last-failed --update-snapshots | |
| env: | |
| VITE_ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:snapshots | |
| TARGET: web | |
| - name: Upload playwright report | |
| uses: actions/upload-artifact@v7 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-snapshot-${{ github.sha }} | |
| path: playwright-report/ | |
| include-hidden-files: true | |
| retention-days: 30 | |
| overwrite: true | |
| - name: Check diff | |
| if: ${{ always() && github.ref != 'refs/heads/main' }} | |
| shell: bash | |
| id: git-check | |
| run: | | |
| git add e2e/playwright/snapshot-tests.spec.ts-snapshots | |
| if git status | grep --quiet "Changes to be committed" | |
| then echo "modified=true" >> $GITHUB_OUTPUT | |
| else echo "modified=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| if: ${{ always() && steps.git-check.outputs.modified == 'true' }} | |
| shell: bash | |
| env: | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_HEAD_REF: ${{ github.head_ref }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git add e2e/playwright/snapshot-tests.spec.ts-snapshots | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git remote set-url origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| git fetch origin | |
| echo "${GITHUB_HEAD_REF}" | |
| git checkout "${GITHUB_HEAD_REF}" | |
| git commit --message "Update snapshots" || true | |
| git push | |
| git push origin "${GITHUB_HEAD_REF}" | |
| - name: Track teardown (snapshots) | |
| if: always() | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:snapshots | |
| CI_STEP: teardown | |
| web: | |
| needs: [build-wasm] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: namespace-profile-ubuntu-8-cores | |
| - os: namespace-profile-macos-8-cores | |
| - os: namespace-profile-windows-8-cores | |
| runs-on: ${{ matrix.os }} | |
| name: e2e:web (${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}) | |
| env: | |
| OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} | |
| steps: | |
| - uses: actions/create-github-app-token@v3.2.0 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.MODELING_APP_GH_APP_ID }} | |
| private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| repository: kittycad/modeling-app # required for 'workflow_call' | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-wasm | |
| path: prepared-wasm | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-ts-rs-bindings | |
| path: prepared-ts-rs-bindings | |
| - name: Copy prepared Wasm | |
| run: | | |
| ls -R prepared-wasm | |
| cp prepared-wasm/kcl_wasm_lib_bg.wasm public | |
| mkdir rust/kcl-wasm-lib/pkg | |
| cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg | |
| # build:wasm generates these ignored ts-rs files in rust/kcl-lib/bindings. | |
| # Restore them here because StdLibCommands is imported as a runtime value. | |
| - name: Copy prepared ts-rs bindings | |
| run: | | |
| ls -R prepared-ts-rs-bindings | |
| mkdir rust/kcl-lib/bindings | |
| cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/ | |
| - uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Download browser cache | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright/ | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} | |
| - name: Install browsers | |
| run: npm run playwright install --with-deps | |
| - name: Start Vector | |
| if: ${{ !contains(matrix.os, 'windows') }} | |
| run: .github/ci-cd-scripts/start-vector-${{ env.OS_NAME }}.sh | |
| env: | |
| GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }} | |
| OS_NAME: ${{ env.OS_NAME }} | |
| - run: npm run test:e2e:web | |
| env: | |
| VITE_ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:web | |
| TARGET: web | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v7 | |
| if: ${{ !cancelled() && (success() || failure()) }} | |
| with: | |
| name: playwright-report-web-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} | |
| path: playwright-report/ | |
| include-hidden-files: true | |
| retention-days: 30 | |
| overwrite: true | |
| - name: Track teardown (web) | |
| if: always() | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:web | |
| CI_STEP: teardown | |
| desktop: | |
| needs: [build-wasm] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [namespace-profile-ubuntu-8-cores] | |
| shardIndex: [1, 2, 3, 4, 5, 6, 7, 8] | |
| shardTotal: [8] | |
| include: | |
| - os: namespace-profile-macos-8-cores | |
| shardIndex: 1 | |
| shardTotal: 1 | |
| - os: namespace-profile-windows-8-cores | |
| shardIndex: 1 | |
| shardTotal: 1 | |
| runs-on: ${{ matrix.os }} | |
| name: e2e:desktop (${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}, shard ${{ matrix.shardIndex }}) | |
| env: | |
| OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| repository: kittycad/modeling-app # required for 'workflow_call' | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-wasm | |
| path: prepared-wasm | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: prepared-ts-rs-bindings | |
| path: prepared-ts-rs-bindings | |
| - name: Copy prepared Wasm | |
| run: | | |
| ls -R prepared-wasm | |
| cp prepared-wasm/kcl_wasm_lib_bg.wasm public | |
| mkdir rust/kcl-wasm-lib/pkg | |
| cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg | |
| # build:wasm generates these ignored ts-rs files in rust/kcl-lib/bindings. | |
| # Restore them here because StdLibCommands is imported as a runtime value. | |
| - name: Copy prepared ts-rs bindings | |
| run: | | |
| ls -R prepared-ts-rs-bindings | |
| mkdir rust/kcl-lib/bindings | |
| cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/ | |
| - uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install dependencies | |
| id: deps-install | |
| run: npm install | |
| - name: Download browser cache | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright/ | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} | |
| - name: Install browsers | |
| run: npm run playwright install --with-deps | |
| - name: Start Vector | |
| if: ${{ !contains(matrix.os, 'windows') }} | |
| run: .github/ci-cd-scripts/start-vector-${{ env.OS_NAME }}.sh | |
| env: | |
| GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }} | |
| OS_NAME: ${{ env.OS_NAME }} | |
| - name: Build app | |
| run: npm run tronb:vite:dev | |
| - uses: actions/download-artifact@v8 | |
| if: ${{ !cancelled() && (success() || failure()) }} | |
| continue-on-error: true | |
| with: | |
| name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} | |
| path: test-results/ | |
| - name: npm run test:e2e:desktop | |
| id: retry | |
| if: ${{ !cancelled() && steps.deps-install.outcome == 'success' }} | |
| uses: nick-fields/retry@v4.0.0 | |
| with: | |
| shell: bash | |
| command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }} | |
| timeout_minutes: 15 | |
| max_attempts: 5 | |
| env: | |
| FAIL_ON_CONSOLE_ERRORS: true | |
| VITE_ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:desktop | |
| TARGET: desktop | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: test-results-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} | |
| path: test-results/ | |
| include-hidden-files: true | |
| retention-days: 30 | |
| overwrite: true | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: playwright-report-desktop-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }} | |
| path: playwright-report/ | |
| include-hidden-files: true | |
| retention-days: 30 | |
| overwrite: true | |
| - name: Track teardown (desktop) | |
| if: always() | |
| run: .github/ci-cd-scripts/track-step.sh | |
| env: | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:desktop | |
| CI_STEP: teardown | |
| vercel: | |
| name: e2e:web (vercel) | |
| runs-on: namespace-profile-ubuntu-8-cores | |
| if: github.repository == 'kittycad/modeling-app' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref_name == 'main')) | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: actions/setup-node@v7.0.0 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Download browser cache | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: ~/.cache/ms-playwright/ | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} | |
| - name: Install browsers | |
| run: npm run playwright install --with-deps | |
| - name: Wait for Vercel (preview) | |
| uses: patrickedqvist/wait-for-vercel-preview@v1.3.3 | |
| id: wait-for-vercel-preview | |
| if: github.event_name == 'pull_request' | |
| continue-on-error: true | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| max_timeout: 800 # average build times are <9 minutes | |
| check_interval: 10 | |
| vercel_protection_bypass_header: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| - name: Wait for Vercel (staging) | |
| uses: patrickedqvist/wait-for-vercel-preview@v1.3.3 | |
| id: wait-for-vercel-staging | |
| if: github.event_name == 'push' && github.ref_name == 'main' | |
| continue-on-error: true | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| environment: staging | |
| max_timeout: 1000 # average build times are <11 minutes | |
| check_interval: 10 | |
| vercel_protection_bypass_header: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| - name: Check Vercel | |
| run: .github/ci-cd-scripts/check-vercel.sh | |
| env: | |
| VERCEL_BASE_URL: ${{ steps.wait-for-vercel-preview.outputs.url || steps.wait-for-vercel-staging.outputs.url }} | |
| VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| - name: npm run test:e2e:web | |
| run: npm run test:e2e:web -- --grep=demo | |
| env: | |
| VERCEL_BASE_URL: ${{ steps.wait-for-vercel-preview.outputs.url || steps.wait-for-vercel-staging.outputs.url }} | |
| VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| VITE_ZOO_API_TOKEN: ${{ secrets.ZOO_API_TOKEN }} | |
| TAB_API_URL: ${{ vars.TAB_API_URL }} | |
| TAB_API_KEY: ${{ secrets.TAB_API_KEY }} | |
| CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| CI_PR_NUMBER: ${{ github.event.pull_request.number }} | |
| CI_SUITE: e2e:web | |
| TARGET: web | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v7 | |
| if: ${{ !cancelled() && (success() || failure()) }} | |
| with: | |
| name: playwright-report-vercel-${{ github.sha }} | |
| path: playwright-report/ | |
| include-hidden-files: true | |
| retention-days: 30 | |
| overwrite: true |