-
-
Notifications
You must be signed in to change notification settings - Fork 5
228 lines (213 loc) · 8.98 KB
/
test-package.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Test npm package
on:
workflow_dispatch:
inputs:
version:
description: "Package version to test"
required: true
im_version:
description: "ImageMagick commit-ish to checkout"
required: false
default: 'main'
jobs:
test_npm_binaries:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
- macos-11
- macos-12
node-version: [16.x, 18.x, 20.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Create package.json
run: npm init --yes
- name: Install fonts on Ubuntu
run: |
[[ '${{ matrix.platform }}' =~ 'ubuntu' ]] && sudo apt-get install -y fonts-ubuntu || true
shell: bash
- name: Set up the unit tests
run: |
curl https://codeload.github.com/mmomtchev/magickwand.js/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip
unzip repo.zip
mv magickwand.js-${{ github.event.inputs.version }}/test .
- name: Install dependencies
run: |
npm i chai chai-spies chai-as-promised mocha typescript ts-node tsconfig-paths \
@types/chai @types/chai-as-promised @types/mocha @types/node \
karma karma-chrome-launcher karma-mocha webpack webpack-cli ts-loader
shell: bash
- name: Install magickwand.js from npm
run: |
npm install --force magickwand.js@${{ github.event.inputs.version }}
mkdir -p deps/ImageMagick/config
cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config
shell: bash
- name: Run the unit tests headless
uses: GabrielBB/xvfb-action@v1
with:
run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts
env:
TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json
MOCHA_INTEGRATION: node,browser
MOCHA_MAGICK_INSTALL: npm install --force magickwand.js@${{ github.event.inputs.version }}
test_npm_rebuild:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-20.04
- ubuntu-22.04
- windows-2022
- macos-11
- macos-12
node-version: [18.x, 20.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Create package.json
run: npm init --yes
- name: Install fonts on Ubuntu
run: |
[[ '${{ matrix.platform }}' =~ 'ubuntu' ]] && sudo apt-get install -y fonts-ubuntu || true
shell: bash
- name: Set up the unit tests
run: |
curl https://codeload.github.com/mmomtchev/magickwand.js/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip
unzip repo.zip
mv magickwand.js-${{ github.event.inputs.version }}/test .
- name: Install dependencies
run: |
npm i chai chai-spies chai-as-promised mocha typescript ts-node tsconfig-paths \
@types/chai @types/chai-as-promised @types/mocha @types/node \
karma karma-chrome-launcher karma-mocha webpack webpack-cli ts-loader
shell: bash
- name: Install magickwand.js from npm
run: |
[[ '${{ matrix.platform }}' =~ 'windows' ]] && subst M: `pwd` && cd M:/
npm install --verbose magickwand.js@${{ github.event.inputs.version }} --build-from-source
mkdir -p deps/ImageMagick/config
cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config
shell: bash
- name: Run the unit tests headless
uses: GabrielBB/xvfb-action@v1
with:
run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts
env:
TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json
MOCHA_INTEGRATION: node,browser
MOCHA_MAGICK_INSTALL: npm install --force magickwand.js@${{ github.event.inputs.version }}
test_npm_rebuild_light:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-22.04
node-version: [18.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Create package.json
run: npm init --yes
- name: Install fonts on Ubuntu
run: |
[[ '${{ matrix.platform }}' =~ 'ubuntu' ]] && sudo apt-get install -y fonts-ubuntu || true
shell: bash
- name: Set up the unit tests
run: |
curl https://codeload.github.com/mmomtchev/magickwand.js/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip
unzip repo.zip
mv magickwand.js-${{ github.event.inputs.version }}/test .
- name: Install dependencies
run: |
npm i chai chai-spies chai-as-promised mocha typescript ts-node tsconfig-paths \
@types/chai @types/chai-as-promised @types/mocha @types/node \
karma karma-chrome-launcher karma-mocha webpack webpack-cli ts-loader
shell: bash
- name: Install magickwand.js from npm
run: |
[[ '${{ matrix.platform }}' =~ 'windows' ]] && subst M: `pwd` && cd M:/
npm install --force magickwand.js@${{ github.event.inputs.version }} \
--build-from-source \
--fonts=false --jpeg=true --png=false --tiff=false \
--webp=false --jpeg2000=false --raw=false --openmedia=false \
--brotli=false --h265=false --exr=false --fftw=false --heif=false \
--jbig=true --cms=false --xml=false --gzip=false --zip=false \
--bzip2=true --zstd=false --xz=false --lzma=false --simd=false \
--openmp=true --display=false
shell: bash
test_npm_rebuild_shared:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04]
node-version: [18.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
with:
repository: 'imagemagick/ImageMagick'
path: 'ImageMagick'
ref: ${{ github.event.inputs.im_version }}
- name: Build and install ImageMagick-7
run: |
cd ImageMagick
sh configure --prefix /usr
make -j4
sudo make install
- name: Create package.json
run: npm init --yes
- name: Install fonts on Ubuntu
run: |
[[ '${{ matrix.platform }}' =~ 'ubuntu' ]] && sudo apt-get install -y fonts-ubuntu || true
shell: bash
- name: Set up the unit tests
run: |
curl https://codeload.github.com/mmomtchev/magickwand.js/zip/refs/tags/v${{ github.event.inputs.version }} --output repo.zip
unzip repo.zip
mv magickwand.js-${{ github.event.inputs.version }}/test .
- name: Install dependencies
run: |
npm i chai chai-spies chai-as-promised mocha typescript ts-node tsconfig-paths \
@types/chai @types/chai-as-promised @types/mocha @types/node \
karma karma-chrome-launcher karma-mocha webpack webpack-cli ts-loader
shell: bash
- name: Install magickwand.js from npm
run: |
[[ '${{ matrix.platform }}' =~ 'windows' ]] && subst M: `pwd` && cd M:/
npm install --force magickwand.js@${{ github.event.inputs.version }} --build-from-source --shared_imagemagick --magicklibs="-lMagick++-7.Q16HDRI -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI"
mkdir -p deps/ImageMagick/config
cp node_modules/magickwand.js/deps/ImageMagick/config/policy-websafe.xml deps/ImageMagick/config
env:
CFLAGS: -I/usr/include/ImageMagick-7
CXXFLAGS: -I/usr/include/ImageMagick-7
shell: bash
- name: Run the unit tests headless
uses: GabrielBB/xvfb-action@v1
with:
run: npx mocha --require ts-node/register --types mocha --reporter=tap --v8-expose-gc --timeout 5000 test/*.test.ts
env:
TS_NODE_PROJECT: ${{ github.workspace }}/test/tsconfig.standalone.json
MOCHA_INTEGRATION: node,browser
MOCHA_MAGICK_INSTALL: npm install --force magickwand.js@${{ github.event.inputs.version }}