-
Notifications
You must be signed in to change notification settings - Fork 16
207 lines (161 loc) · 6.2 KB
/
build-test-and-artifact.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Build, run test and upload binaries
on: [push, pull_request]
jobs:
linux-x86-clang:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-x86-clang-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
linux-x86-gcc:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-x86-gcc-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
linux-arm-gcc-crosscompile:
runs-on: "ubuntu-20.04"
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install netcat-openbsd qemu-user-binfmt qemu-user g++-multilib-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DSTATIC_COMPILE=yes -DDISABLE_PCAP=yes -DDISABLE_SDL=yes -DDISABLE_X11=yes -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall" -DCMAKE_C_COMPILER="arm-linux-gnueabihf-gcc-9" -DCMAKE_CXX_COMPILER="arm-linux-gnueabihf-g++-9" -DCMAKE_CXX_FLAGS="-O3 -march=armv7ve"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Binary info
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: file ${{runner.workspace}}/build/axpbox
- name: Run test scripts
working-directory: ${{runner.workspace}}/axpbox
shell: bash
run: ${{runner.workspace}}/axpbox/test/run
- name: Upload AXPbox binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-linux-ARM-gcc-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
windows-x86-msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Test run
working-directory: ${{runner.workspace}}/build
run: ${{runner.workspace}}\build\Release\axpbox.exe
- name: Upload AXPbox Binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-windows-x86-msvc-${{ env.BUILD_DATE }}.exe
path: ${{runner.workspace}}\build\Release\axpbox.exe
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
osx-x86-appleclang:
runs-on: "macos-12"
steps:
- uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Install dependencies
run: brew install libpcap netcat gnu-sed # sdl2 libx11 / sdl doesnt work see #44
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -std=c++11 -stdlib=libc++ -I/usr/local/opt/libpcap/include"
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
env:
MAKEFLAGS: "-j2"
- name: Upload AXPbox Binary
uses: actions/upload-artifact@v1
with:
name: AXPbox-osx-x86-12-appleclang-${{ env.BUILD_DATE }}
path: ${{runner.workspace}}/build/axpbox
env:
BUILD_DATE: ${{ steps.date.outputs.date }}