Repository navigation
114 lines (97 loc) · 3.49 KB
/
Copy pathdocs-tests.yml
File metadata and controls
114 lines (97 loc) · 3.49 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: docs tests
on:
workflow_dispatch:
# the release-tests workflow reruns this suite at the released tag
workflow_call:
# direct pushes are the norm in this repo — they get the same
# path-scoped coverage as PRs (rapid push trains collapse through the
# per-ref concurrency group)
push:
branches:
- 'dev'
paths:
- '.github/workflows/docs-tests.yml'
- 'docs/**'
# root dependency changes affect every package
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
pull_request:
types: [opened, synchronize]
branches:
- 'dev'
paths:
- '.github/workflows/docs-tests.yml'
- 'docs/**'
# root dependency changes affect every package
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
# literal prefix instead of github.workflow: when called from another
# workflow, github.workflow resolves to the CALLER's name, which would
# collide with the other suites called from the same run
concurrency:
group: docs-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
permissions:
contents: read # to fetch code (actions/checkout)
actions: read # to correctly identify workflow run
runs-on: ubuntu-latest
# the in-test deadlines are far shorter; this only catches hangs
# (the e2e-ssr suite boots a dev server; test:build does a full
# SSG build)
timeout-minutes: 45
name: Tests for quasar.dev
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
# The test suite needs the built ui package (its generated API
# files). Same exact-input-hash cache key as app-vite's build-ui
# job, so runs usually restore instead of building; no
# restore-keys on purpose — a stale dist must never be served.
- name: Restore UI build cache
id: ui-build-cache
uses: actions/cache@v5
with:
path: ui/dist
key: ui-dist-${{ runner.os }}-${{ hashFiles('ui/src/**', 'ui/lang/**', 'ui/icon-set/**', 'ui/types/**', 'ui/build/**', 'ui/package.json', 'pnpm-lock.yaml') }}
- name: Build the UI package
if: steps.ui-build-cache.outputs.cache-hit != 'true'
run: pnpm --filter quasar build
# Playwright validates browser revisions by directory, so restoring
# a stale cache just triggers a fresh download of the right one
- name: Setup Playwright browser cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: playwright-${{ runner.os }}-
- name: Install Playwright browser
run: pnpm --filter quasar.dev exec playwright install --with-deps chromium
- name: Run tests
run: pnpm --filter quasar.dev test
# Upload required artifacts to be used in tests-report.yml
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: test-results
path: docs/test-results
- name: Upload GitHub Actions event data
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: event-data
path: ${{ github.event_path }}
overwrite: true