-
Notifications
You must be signed in to change notification settings - Fork 177
171 lines (170 loc) · 5.89 KB
/
cmake.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
name: CMake Build
on: [push, pull_request]
env:
CACHE_NUMBER: 2
COMPILER_VERSION: 2022.0.3
BUILD_TYPE: Release
jobs:
build_unix_gcc:
# Set the name of this build, variable depending on the OS and whether it
# includes the lua engine
name: build ${{ matrix.os }} - lua=${{ matrix.lua }} - gcc
strategy:
fail-fast: false
# The matrix sets all the different combinations of builds, e.g. platforms
# and build configurations
matrix:
os:
- ubuntu-latest
- macos-latest
lua:
- on
- off
# Set the platform to build on
runs-on: ${{ matrix.os }}
steps:
# Check out the smv repo
- name: Checkout code
uses: actions/checkout@v3
# If we are currently building on Linux (ubuntu) install all the native
# pre-requisites
- name: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install build-essential freeglut3-dev libx11-dev libxmu-dev libxi-dev libglew-dev libgd-dev liblua5.4-dev libjson-c-dev
# If we are building on macos configure the environment to use gcc-14 as
# the compiler
- name: set macos gcc
if: runner.os == 'macOS'
shell: bash
run: |
echo "CC=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
brew install glew lua gd zlib json-c
# If we are building on linux configure the environment to use gcc as the
# compiler
- name: set linux gcc
if: runner.os == 'Linux'
shell: bash
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
# Run cmake to build smokeview
- name: Build
shell: bash
run: |
cmake -B ${{github.workspace}}/cbuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLUA=${{ matrix.lua }}
cmake --build ${{github.workspace}}/cbuild -j4
cp ${{github.workspace}}/cbuild/smokeview smokeview
# Run the CMake-based tests on MacOS
- name: Test
if: runner.os == 'macOS'
shell: bash
run: |
ctest --test-dir cbuild -j10 --output-on-failure -V
# Run the CMake-based tests on Linux
- name: Test
if: runner.os == 'Linux'
shell: bash
run: |
xvfb-run ctest --test-dir cbuild -j10 --output-on-failure -V
# Set a suffix based on whether lua is included
- name: Set exec suffix
if: ${{ matrix.lua }}
run: echo "exec_suffix=-lua" >> $GITHUB_ENV
# Archive the smokeview executable
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: smokeview-${{ runner.os }}-${{ env.exec_suffix }}
path: smokeview
#build_unix_rpm_gcc:
# name: build (rpm) ${{ matrix.os }} - lua=${{ matrix.lua }} - gcc
# runs-on: ubuntu-latest
# container: centos:7
# strategy:
# fail-fast: false
# matrix:
# lua:
# - on
# - off
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install linux deps
# run: |
# yum -y install epel-release
# yum -y install cmake3
# yum -y install make gcc-c++ mesa-libGL-devel glut-devel libjpeg-devel libpng-devel gd-devel glew-devel libXmu-devel libXi-devel lua-devel json-c-devel
# yum -y install wget unzip git
# - name: set gcc
# shell: bash
# run: |
# echo "CC=gcc" >> $GITHUB_ENV
# echo "CXX=g++" >> $GITHUB_ENV
# - name: Build
# shell: bash
# run: |
# pkg-config --cflags json-c
# cmake3 -B ${{github.workspace}}/cbuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLUA=${{ matrix.lua }}
# cmake3 --build ${{github.workspace}}/cbuild -j4
# cp ${{github.workspace}}/cbuild/smokeview smokeview
# # - name: Test
# # shell: bash
# # working-directory: ${{github.workspace}}/cbuild
# # run: |
# # ctest -j10 --output-on-failure -V
# - name: Set exec suffix
# if: ${{ matrix.lua }}
# run: echo "exec_suffix=-lua" >> $GITHUB_ENV
# - name: Archive production artifacts
# uses: actions/upload-artifact@v3
# with:
# name: smokeview-${{ runner.os }}-${{ env.exec_suffix }}
# path: smokeview
build_windows_msvc:
name: build ${{ matrix.os }} - lua=${{ matrix.lua }} - msvc
strategy:
fail-fast: false
matrix:
os:
- windows-2022
lua:
- on
- off
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Pin vcpkg version
run: |
cd C:\vcpkg
git fetch
git checkout 2024.03.25
.\\bootstrap-vcpkg.bat
- name: build smokeview
shell: cmd
run: |
cmake --version
cmake -B ${{github.workspace}}\cbuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLUA_UTIL_LIBS=ON -DLUA=${{ matrix.lua }} -DLUA_BUILD_BINARY=${{ matrix.lua }} -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake -DLUA_BUILD_BINARY=ON
cmake --build ${{github.workspace}}\cbuild -j4 --config ${{env.BUILD_TYPE}}
copy ${{github.workspace}}\cbuild\Release\smokeview.exe smokeview.exe
- name: Test
shell: bash
working-directory: ${{github.workspace}}/cbuild
env:
LUA: ${{ matrix.lua }}
run: |
ctest -j10 -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Set exec suffix
if: ${{ matrix.lua }}
run: echo "exec_suffix=-lua" >> $GITHUB_ENV
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: smokeview-windows-msvc-${{ env.exec_suffix }}
path: smokeview.exe