-
Notifications
You must be signed in to change notification settings - Fork 33
133 lines (115 loc) · 3.56 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
131
132
133
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
nice-grpc:
name: nice-grpc
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
environment:
- node-version: '14.15'
node-options: --require "abort-controller/polyfill"
- node-version: '14.17'
node-options: --experimental-abortcontroller
- node-version: 16.x
- node-version: 18.x
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.environment.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.environment.node-version }}
- name: Restore Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key:
modules-${{ runner.os }}-${{ matrix.environment.node-version }}-${{
hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile --ignore-engines
- run: yarn build --ignore nice-grpc-web
- env:
NODE_OPTIONS: ${{ matrix.environment.node-options }}
run:
yarn test --ignore nice-grpc-web --since ${{ github.ref ==
'refs/heads/master' && github.event.before || format('origin/{0}',
github.base_ref) }}
nice-grpc-web-nodejs:
name: nice-grpc-web NodeJS
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
environment:
- node-version: 16.x
node-options: --experimental-fetch
- node-version: 18.x
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.environment.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.environment.node-version }}
- name: Restore Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key:
modules-${{ runner.os }}-${{ matrix.environment.node-version }}-${{
hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn build
- env:
NODE_OPTIONS: ${{ matrix.environment.node-options }}
run:
yarn test --scope nice-grpc-web --since ${{ github.ref ==
'refs/heads/master' && github.event.before || format('origin/{0}',
github.base_ref) }}
nice-grpc-web-browser:
name: nice-grpc-web Browser
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Restore Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: modules-${{ runner.os }}-18.x-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn build
- run:
yarn lerna run test:local-browser-headless --scope nice-grpc-web
--since ${{ github.ref == 'refs/heads/master' && github.event.before
|| format('origin/{0}', github.base_ref) }}
# Empty job that finishes after all required jobs finish.
# Needed to not have to specify every single required job in branch protection.
success:
needs:
- nice-grpc
- nice-grpc-web-nodejs
- nice-grpc-web-browser
runs-on: ubuntu-latest
steps:
- run: echo "Done"