-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make tests OS agnostic (#616)
Co-authored-by: Edmund Hung <me@edmund.dev>
- Loading branch information
1 parent
1a9c9bd
commit 09063d6
Showing
28 changed files
with
14,782 additions
and
12,584 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,64 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
- v1 | ||
branches: [main, next, v1] | ||
pull_request: | ||
branches: | ||
- main | ||
- next | ||
- v1 | ||
branches: [main, next, v1] | ||
jobs: | ||
unit: | ||
name: API Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Download deps | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Build packages | ||
run: pnpm run build | ||
- name: Run tests | ||
- name: Run Vitest tests | ||
run: pnpm exec vitest | ||
- name: Typecheck | ||
- name: Run Typecheck | ||
run: pnpm -r run typecheck | ||
|
||
e2e: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
browser: [chromium, firefox, webkit] | ||
node: [18, 20, 22] | ||
exclude: | ||
- os: macos-latest | ||
browser: firefox | ||
- os: windows-latest | ||
browser: firefox | ||
- os: windows-latest | ||
browser: webkit | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- uses: pnpm/action-setup@v2 | ||
uses: actions/setup-node@v4 | ||
with: | ||
version: 8 | ||
- name: Download deps | ||
node-version: ${{ matrix.node }} | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- name: Install dependencies | ||
run: pnpm i | ||
- name: Install Playwright | ||
run: pnpm exec playwright install --with-deps | ||
- name: Run tests | ||
run: pnpm exec playwright test | ||
- name: Upload test result | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps ${{ matrix.browser }} | ||
- name: Run Playwright tests | ||
run: pnpm exec playwright test --project=${{ matrix.browser }} | ||
- name: Upload report to GitHub Actions Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test-results | ||
name: playwright-report-${{ matrix.os }}-node${{ matrix.node }}-${{ matrix.browser }} | ||
path: test-results/ | ||
retention-days: 30 | ||
retention-days: 14 |
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
Oops, something went wrong.