forked from mne-tools/mne-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 3.1 KB
/
wasmtest.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
name: WasmTest
on:
push:
branches:
# Change this to the branch name you make changes to the documentation on
- wasm
jobs:
WasmTest:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Setup emscripten compiler
run: |
cd ..
# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory and pull
cd emsdk
git pull
# Download and install the latest SDK tools.
./emsdk install 1.39.7
# - name: Install Qt
# run: |
# # Download the pre-built static version of Qt, which was created with the generateBinaries.yml workflow
# wget -O qt5_5151_static_binaries_wasm.tar.gz https://www.dropbox.com/s/6uxny1ruajf3q91/qt5_5151_static_binaries_wasm.tar.gz?dl=1
# mkdir ../Qt5_binaries
# tar xvzf qt5_5151_static_binaries_wasm.tar.gz -C ../ -P
# Uncomment this if you want to build Qt statically in this workflow
- name: Compile wasm Qt version
run: |
cd ..
# Make the "latest" emscripten SDK "active" for the current user.
./emsdk/emsdk activate 1.39.7
# Activate PATH and other environment variables in the current terminal
source ./emsdk/emsdk_env.sh
# Clone Qt5 repo
git clone https://code.qt.io/qt/qt5.git -b 5.15.1
cd qt5
./init-repository -f --module-subset=qtbase,qtcharts,qtsvg
# Configure Qt5
./configure -xplatform wasm-emscripten -feature-thread -skip webengine -nomake tests -nomake examples -no-dbus -no-ssl -no-pch -opensource -confirm-license -prefix "$PWD/../Qt5_binaries"
make module-qtbase module-qtsvg module-qtcharts -j4
make install -j4
- name: Configure and compile MNE-CPP
run: |
cd ..
# Make the "latest" emscripten SDK "active" for the current user.
./emsdk/emsdk activate 1.39.7
# Activate PATH and other environment variables in the current terminal
source ./emsdk/emsdk_env.sh
# Compile MNE-CPP
cd mne-cpp
../Qt5_binaries/bin/qmake -r MNECPP_CONFIG=wasm
make -j4
- name: Setup Github credentials
uses: fusion-engineering/setup-git-credentials@v2
with:
credentials: ${{secrets.GIT_CREDENTIALS_WASM_TEST}}
- name: Update gh-pages branch with new wasm version
run: |
# Setup git credentials
git config --global user.email dev@dev.com
git config --global user.name dev
# Save the wasm files first
cp -RT bin/ ../bin
# Replace logo
cp -RT tools/design/logos/qtlogo.svg ../bin/qtlogo.svg
# Checkout the gh-pages branch
git fetch origin gh-pages
git checkout --track origin/gh-pages
# Clean and remove all files first
git clean -f -d
git rm * -r
git commit --amend -a -m 'Update wasm' --allow-empty
# Add the saved wasm files
cp -RT ../bin .
git add --all
git commit --amend -a -m 'Update wasm'
git push origin gh-pages -f