-
-
Notifications
You must be signed in to change notification settings - Fork 38
180 lines (154 loc) · 6.38 KB
/
test-npm.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Test npm package
on:
workflow_dispatch:
inputs:
rlayers:
description: 'Package version to test'
required: true
ol:
description: 'OL version to use'
required: true
jobs:
test_npm_package:
runs-on: ${{ matrix.platforms }}
strategy:
matrix:
platforms: [ubuntu-latest, windows-latest, macos-latest]
steps:
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}"
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Set up the unit tests
run: |
curl https://codeload.github.com/mmomtchev/rlayers/zip/refs/tags/v${{ github.event.inputs.rlayers }} --output repo.zip
unzip repo.zip
mv rlayers-${{ github.event.inputs.rlayers }}/package.json .
mv rlayers-${{ github.event.inputs.rlayers }}/tsconfig*.json .
mv rlayers-${{ github.event.inputs.rlayers }}/jest.standalone.config.js jest.config.js
curl https://raw.githubusercontent.com/mmomtchev/rlayers/main/jest.standalone.config.js --output jest.config.js
mv rlayers-${{ github.event.inputs.rlayers }}/examples .
mv rlayers-${{ github.event.inputs.rlayers }}/test .
- name: Install from npm
run: npm install rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
- name: Run the unit tests
run: |
rm package.json
npx jest -c jest.config.js
env:
STADIA_MAPS_API_KEY: ${{ secrets.STADIA_MAPS_API_KEY }}
cra_react18_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-js
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-ts
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_1_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-1-js
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_1_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-1-ts
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_2_js:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-2-js
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_2_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-2-ts
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
cra_react18_3_ts:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/cra-react18-3-ts
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
nextjs12:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next12
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
nextjs13:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next13
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
nextjs13-esm:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next13-esm
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build
nextjs14-esm:
runs-on: ubuntu-latest
steps:
- run: git clone https://github.com/mmomtchev/rlayers-npm-tests.git
- name: Run bundler
run: |
cd rlayers-npm-tests/next14-esm
npm install
npm i rlayers@${{ github.event.inputs.rlayers }} ol@${{ github.event.inputs.ol }}
npm run build