Skip to content

Commit

Permalink
feat: Highly unlikely to work attempt to speed up integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent d6b4cb0 commit 66749cd
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,36 @@ jobs:
- run: pnpm run lint
- run: cd packages/kit && pnpm prepublishOnly && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please run prepublishOnly locally and commit the changes after you have reviewed them"; git diff; exit 1); }
- run: pnpm run check
list-kit-test-packages:
runs-on: ubuntu-latest
outputs:
package_groups: ${{ steps.set-package-groups.outputs.package_groups }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: List and group test packages
id: set-package-groups
run: |
package_groups=$(
pnpm -r --filter="./packages/kit/test/**" exec sh -c '
if [ -n "$(pnpm pkg get scripts.test 2>/dev/null)" ]; then
echo "$(basename $PWD)"
fi
' | sort | uniq | jq -Rsc 'split("\n") | map(select(. != "")) | [range(0; length; 4) | .[:4]]'
)
echo "package_groups=$package_groups" >> $GITHUB_OUTPUT
test-kit:
needs: list-kit-test-packages
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
package_group: ${{ fromJson(needs.list-kit-test-packages.outputs.package_groups) }}
node-version: [18, 20, 22]
include:
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
- node-version: 20
os: ubuntu-latest
e2e-browser: 'chromium'
- node-version: 22
os: ubuntu-latest
- os: ubuntu-latest
e2e-browser: 'chromium'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
Expand All @@ -69,10 +84,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:kit
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright
run: pnpm playwright install ${{ matrix.e2e-browser }}
- name: Run tests
run: |
pnpm run sync-all
pnpm --filter="${{ matrix.package_group }}" test
- name: Print flaky test report
run: node scripts/print-flaky-test-report.js
- name: Archive test results
Expand All @@ -84,8 +103,22 @@ jobs:
uses: actions/upload-artifact@v4
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}-${{ matrix.package_group }}
path: test-results.tar.gz
test-kit-results:
if: always()
needs: test-kit
runs-on: ubuntu-latest
steps:
- name: Check test results
run: |
if [ "${{ needs.test-kit.result }}" = "success" ]; then
echo "All tests passed successfully!"
exit 0
else
echo "Some tests failed. Please check the individual job results."
exit 1
fi
test-kit-cross-browser:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down

0 comments on commit 66749cd

Please sign in to comment.