forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (98 loc) · 2.81 KB
/
tests-on-pr.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
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
115
116
117
118
119
120
121
122
123
124
name: UI tests
on:
pull_request:
types: [opened, synchronize]
branches:
- 'dev'
paths:
- '.github/workflows/tests-on-pr.yml'
- 'ui/**/*.js'
- 'ui/package.json'
- 'ui/playground/package.json'
jobs:
build:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
# Check if the build cache exists, and if it does, do nothing else.
# Otherwise, run the build and cache it.
name: Build the packages
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Build the UI package
working-directory: ui
run: pnpm build
- name: Upload UI build artifact
uses: actions/upload-artifact@v4
with:
name: ui-build
path: ui/dist
- name: Build vite-plugin package
working-directory: vite-plugin
run: pnpm build
- name: Upload vite-plugin build artifact
uses: actions/upload-artifact@v4
with:
name: vite-plugin-build
path: vite-plugin/dist
tests:
# If the build pipeline doesn't succeed, we don't need to run tests at all
needs: build
permissions:
contents: read # to fetch code (actions/checkout)
actions: read # to correctly identify workflow run
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
strategy:
fail-fast: false
name: Tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm i
- name: Download UI build artifact
uses: actions/download-artifact@v4
with:
name: ui-build
path: ui/dist
- name: Download vite-plugin build artifact
uses: actions/download-artifact@v4
with:
name: vite-plugin-build
path: vite-plugin/dist
- name: Run tests
run: pnpm test
# Upload required artifacts to be used in tests-on-pr-report.yml
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: test-results
path: ui/testing/test-results
- name: Upload GitHub Actions event data
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: event-data
path: ${{ github.event_path }}
overwrite: true