-
Notifications
You must be signed in to change notification settings - Fork 36
55 lines (53 loc) · 1.95 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Run tests
on:
push:
paths:
- "package/**"
- "integration-test/**"
pull_request:
paths:
- "package/**"
- "integration-test/**"
workflow_dispatch:
jobs:
test:
name: Run unit tests
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn workspace @apollo/experimental-nextjs-app-support run test > $GITHUB_STEP_SUMMARY
tests_playwright:
name: Run Playwright tests
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Get installed Playwright version
id: playwright-version
run: yarn why @playwright/test --json | jq '.children|to_entries[0].value.locator' --raw-output | sed 's/^.*npm:/PLAYWRIGHT_VERSION=/' >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Build
run: yarn workspaces foreach -R -t --from integration-test run build
- name: Run tests
run: yarn workspace integration-test run test > $GITHUB_STEP_SUMMARY