-
Notifications
You must be signed in to change notification settings - Fork 119
151 lines (144 loc) · 4.58 KB
/
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
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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
strategy:
matrix:
cxx: [g++-12, clang++-14]
include:
- cxx: g++-12
cc: gcc-12
- cxx: clang++-14
cc: clang-14
steps:
- uses: actions/checkout@v1
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install opengl
run: sudo apt-get -o Acquire::Retries=3 install mesa-common-dev libgl1-mesa-dev libgl1-mesa-glx
- name: cmake
working-directory: dev
run: CXX=${{ matrix.cxx }} CC=${{ matrix.cc }} cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON .
- name: build
working-directory: dev
run: make -j4
- name: test
run: bin/lobster tests/unittest.lobster
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Linux Lobster binary ${{ matrix.cxx }}
path: bin/lobster
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
- name: cmake cpp output
working-directory: dev
# In addition to C++ out, build this one in Debug and without the engine for extra coverage.
run: CXX=${{ matrix.cxx }} CC=${{ matrix.cc }} cmake -DCMAKE_BUILD_TYPE=Debug -DLOBSTER_WERROR=ON -DLOBSTER_TOCPP=ON -DLOBSTER_ENGINE=OFF .
- name: build cpp output
working-directory: dev
run: make -j4
- name: test cpp output
run: bin/compiled_lobster
build-windows:
name: Build Windows
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: build
working-directory: dev/lobster
run: msbuild.exe lobster.sln /p:Configuration=Release /p:Platform=x64
- name: test
run: bin/lobster.exe tests/unittest.lobster
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Windows Lobster binary
path: bin/lobster.exe
build-mac:
name: Build Mac
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: cmake
working-directory: dev
run: sh build_osx.sh
- name: build
working-directory: dev/xcode-cmake
run: xcodebuild -toolchain clang -configuration Release -target lobster
- name: test
run: bin/lobster tests/unittest.lobster
- name: upload build artifacts
uses: actions/upload-artifact@v1
with:
name: Mac Lobster binary
path: bin/lobster
build-android:
name: Build Android (on Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Now we're first going to build the native Linux exe, so we can generate C++ code.
# Without engine should speed this up.
- name: cmake
working-directory: dev
run: CXX=clang++-14 CC=clang-14 cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON -DLOBSTER_ENGINE=OFF .
- name: build
working-directory: dev
run: make -j4
# Generate C++ code.
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
- name: build android
working-directory: dev/android-project
run: bash ./gradlew buildDebug
build-emscripten:
name: Build Wasm (on Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install ninja
run: sudo apt-get -o Acquire::Retries=3 install ninja-build
- name: emsdk install
run: |
mkdir $HOME/emsdk
git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
$HOME/emsdk/emsdk update-tags
$HOME/emsdk/emsdk install tot
$HOME/emsdk/emsdk activate tot
echo "$HOME/emsdk" >> $GITHUB_PATH
# Now we're first going to build the native Linux exe, so we can generate C++ code.
# Without engine should speed this up.
- name: cmake
working-directory: dev
run: CXX=clang++-14 CC=clang-14 cmake -DCMAKE_BUILD_TYPE=Release -DLOBSTER_WERROR=ON -DLOBSTER_ENGINE=OFF .
- name: build
working-directory: dev
run: make -j4
# Generate C++
- name: test cpp generation
run: bin/lobster --cpp tests/unittest.lobster
# Build.
- name: emcc-build cpp
run: |
source $HOME/emsdk/emsdk_env.sh
cd dev/emscripten && make -j4