-
Notifications
You must be signed in to change notification settings - Fork 101
186 lines (162 loc) · 5.76 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
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
name: 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"]'
###########################################################
build:
###########################################################
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
target: [linux, darwin, darwin14, windows]
architecture: [32, 64]
cmake_preset: [ Debug, Release ]
include:
- target: linux
runner: ubuntu-latest
archive_ext: tar.gz
- target: darwin
runner: macos-latest
archive_ext: tar.gz
- target: darwin14
runner: macos-14
archive_ext: tar.gz
- target: windows
runner: windows-latest
archive_ext: zip
- target: windows
build_system: cmake
cmake_generator: Visual Studio 17 2022
- target: darwin
build_system: cmake
cmake_generator: Ninja
- target: darwin14
build_system: cmake
cmake_generator: Ninja
- target: linux
build_system: cmake
cmake_generator: Ninja
- target: windows
architecture: 32
architecture_string: Win32
- target: windows
architecture: 64
architecture_string: x64
exclude:
- target: darwin
architecture: 32
- target: darwin14
architecture: 32
- target: linux
architecture: 32
steps:
- name: "SCM Checkout"
uses: actions/checkout@v3
- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- name: "Install: Required Dev Packages"
run: |
set -eux
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
;;
darwin64)
brew install bison
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/bison/lib"
;;
darwin1464)
brew install bison
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> /Users/runner/.bash_profile
export LDFLAGS="-L/opt/homebrew/opt/bison/lib"
;;
esac
- name: "Build: DaScript"
run: |
set -eux
mkdir build
case "${{ matrix.build_system }}" in
cmake)
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64)
cmake --no-warn-unused-cli -B./build -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_preset }} -G "${{ matrix.cmake_generator }}"
cd build
ninja daScript
ninja daScriptTest
;;
windows*)
cmake --no-warn-unused-cli -B./build -G "${{ matrix.cmake_generator }}" -T host=x86 -A ${{ matrix.architecture_string }}
cmake --build ./build --config ${{ matrix.cmake_preset }} --target daScript
cmake --build ./build --config ${{ matrix.cmake_preset }} --target daScriptTest
;;
*)
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_preset }} -G "${{ matrix.cmake_generator }}"
cd build
ninja daScript
ninja daScriptTest
;;
esac
;;
esac
- name: "Test"
run: |
set -eux
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64)
cd bin
./daScriptTest
./daScript _dasroot_/dastest/dastest.das -- --color --test ../tests || ./daScript _dasroot_/dastest/dastest.das -- --color --isolated-mode --timeout 1200 --test ../tests
;;
windows*)
cd bin/"${{ matrix.cmake_preset }}"
./daScriptTest.exe
./daScript _dasroot_/dastest/dastest.das -- --color --test ../../tests || ./daScript _dasroot_/dastest/dastest.das -- --color --isolated-mode --timeout 1200 --test ../../tests
;;
*)
cd bin
./daScriptTest
./daScript _dasroot_/dastest/dastest.das -- --color --test ../tests || ./daScript _dasroot_/dastest/dastest.das -- --color --isolated-mode --timeout 1200 --test ../tests
;;
esac