-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (100 loc) · 3.31 KB
/
ci.yaml
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
125
126
127
128
129
130
name: Continuous Integration
on: pull_request
jobs:
unit-test:
strategy:
fail-fast: false
matrix:
node:
- node-version-file: 'package.json'
- node-version: 20.x
name: Unit tests w/ Node.js ${{matrix.node.node-version || matrix.node.node-version-file}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node ${{matrix.node.node-version || matrix.node.node-version-file}}
uses: actions/setup-node@v4
with: ${{matrix.node}}
- name: Cache build:all
id: cache-build
uses: actions/cache@v4
with:
path: packages/published/**/dist
key: ${{ matrix.node }}-cache-build-${{ hashFiles('packages/published/**', 'yarn.lock') }}
- run: yarn install
- name: Build all plugins
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:all
- run: yarn test:unit
e2e:
timeout-minutes: 10
name: End to End
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Cache build:all
id: cache-build
uses: actions/cache@v4
with:
path: packages/published/**/dist
key: node18-cache-build-${{ hashFiles('packages/published/**', 'yarn.lock') }}
- name: Cache playwright binaries
id: cache-playwright-binaries
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
~/Library/Caches/ms-playwright
%USERPROFILE%\AppData\Local\ms-playwright
key: cache-playwright-binaries-${{ hashFiles('yarn.lock') }}
- run: yarn install
- name: Install playwright
run: yarn workspace @dd/tests playwright install --with-deps
- name: Build all plugins
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:all
- run: yarn test:e2e
- name: Save playwright cache
if: always() && steps.cache-playwright-binaries.outputs.cache-hit != 'true'
id: save-playwright-cache
uses: actions/cache/save@v4
with:
path: |
~/.cache/ms-playwright
~/Library/Caches/ms-playwright
%USERPROFILE%\AppData\Local\ms-playwright
key: cache-playwright-binaries-${{ hashFiles('yarn.lock') }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && failure() }}
with:
name: playwright
path: |
packages/tests/playwright-report
packages/tests/test-results
retention-days: 3
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Cache build:all
id: cache-build
uses: actions/cache@v4
with:
path: packages/published/**/dist
key: node18-cache-build-${{ hashFiles('packages/published/**', 'yarn.lock') }}
- run: yarn install
- name: Build all plugins
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:all
- run: yarn typecheck:all
- run: yarn cli integrity
- run: git diff --exit-code && git diff --cached --exit-code || (echo "Please run 'yarn cli integrity' and commit the result." && exit 1)