-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (36 loc) · 1.49 KB
/
build_opencv.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
name: Build OpenCV and webARKitCV libs
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch.
# This script will build the opencv_js.js lib and WebARKitCV.js libs.
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: git submodule update --init
- run: npm install
- run: docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:3.1.26 emcmake python3 ./opencv/platforms/js/build_js.py opencv_js --config="./opencv.webarkit_config.py" --build_wasm --cmake_option="-DBUILD_opencv_dnn=OFF" --cmake_option="-DBUILD_opencv_objdetect=OFF" --cmake_option="-DBUILD_opencv_photo=OFF" --build_flags="-s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0"
- run: cp -r opencv_js/bin/opencv_js.js build
- uses: actions/upload-artifact@v4
with:
name: build
path: build
- run: npm run build-ts
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist