-
Notifications
You must be signed in to change notification settings - Fork 104
116 lines (100 loc) · 3.27 KB
/
wasm_build.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
name: wasm_build
on:
push:
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
###########################################################
pre_job:
###########################################################
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch"]'
###########################################################
wasm_build:
###########################################################
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
target: [linux, darwin, windows]
architecture: [ 64 ]
cmake_preset: [ Release ]
include:
- target: linux
runner: ubuntu-latest
- target: darwin
runner: macos-latest
- target: windows
runner: windows-latest
- target: windows
architecture: 64
architecture_string: x64
steps:
- name: "SCM Checkout"
uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: "Install: Required Dev Packages"
run: |
set -eux
git clone https://github.com/emscripten-core/emsdk.git
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64)
echo "MARCH=64" >> $GITHUB_ENV
sudo apt-get update -y
sudo apt-get install --no-install-recommends -y \
libatomic-ops-dev \
libglu1-mesa-dev \
freeglut3-dev \
mesa-common-dev \
libglfw3-dev \
libfreetype6-dev \
libudev-dev \
libopenal-dev \
libvorbis-dev \
libflac-dev \
libclang-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev
./emsdk/emsdk install latest
./emsdk/emsdk activate latest
source "/home/runner/work/daScript/daScript/emsdk/emsdk_env.sh"
;;
windows*)
./emsdk/emsdk install latest
./emsdk/emsdk activate latest
./emsdk/emsdk_env.bat
;;
*)
./emsdk/emsdk install latest
./emsdk/emsdk activate latest
source "/Users/runner/work/daScript/daScript/emsdk/emsdk_env.sh"
;;
esac
- name: "Build: daslang web"
run: |
set -eux
cd web
cp ../CMakeXxdImpl.txt .
rm -r -f cmake_temp
mkdir cmake_temp
cd cmake_temp
cmake -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_preset }} -G Ninja -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake ../
ninja