Skip to content

Commit 189d1bb

Browse files
authored
Update Actions (#14)
1 parent e34986c commit 189d1bb

File tree

1 file changed

+123
-52
lines changed

1 file changed

+123
-52
lines changed

.github/workflows/cmake.yml

Lines changed: 123 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,135 @@
11
name: Build WebUI #& cWebUI
2-
32
on:
43
push:
54
pull_request:
65
branches:
76
- main
87

8+
env:
9+
BUILD_TYPE: Release
10+
BOOST_VER: 1.76.0
11+
BOOST_LIBS: date_time filesystem regex
12+
913
jobs:
10-
build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
os: [ubuntu-latest, windows-latest]
15-
runs-on: ${{ matrix.os }}
14+
GCC-Linux:
15+
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v2
19+
20+
- name: Cache Boost
21+
uses: actions/cache@v2
22+
with:
23+
path: '${{ runner.workspace }}/boost_*.tar.gz'
24+
key: 'boost-${{env.BOOST_VER}}'
25+
26+
- name: Build Boost
27+
id: boost
28+
uses: egor-tensin/build-boost@v1
29+
with:
30+
version: ${{env.BOOST_VER}}
31+
libraries: ${{env.BOOST_LIBS}}
32+
platform: x64
33+
configuration: ${{env.BUILD_TYPE}}
34+
35+
- name: Create Build Environment
36+
run: cmake -E make_directory ${{github.workspace}}/build
1937

20-
# Both System
21-
- name: Create Build Environment
22-
run: cmake -E make_directory ${{github.workspace}}/build
38+
- name: Configure CMake
39+
env:
40+
BOOST_ROOT: ${{steps.boost.outputs.root}}
41+
BOOST_LIBRARYDIR: ${{steps.boost.outputs.librarydir}}
42+
working-directory: ${{github.workspace}}/build
43+
run: cmake $GITHUB_WORKSPACE
44+
45+
- name: Build
46+
working-directory: ${{github.workspace}}/build
47+
run: cmake --build .
48+
49+
MinGW-Windows:
50+
runs-on: windows-latest
2351

24-
# GNU/Linux
25-
- name: Install Boost
26-
if: matrix.os == 'ubuntu-latest'
27-
run: sudo apt install libboost-all-dev
28-
29-
- name: Configure CMake
30-
if: matrix.os == 'ubuntu-latest'
31-
working-directory: ${{github.workspace}}/build
32-
run: cmake $GITHUB_WORKSPACE
33-
34-
- name: Build WebUI
35-
if: matrix.os == 'ubuntu-latest'
36-
working-directory: ${{github.workspace}}/build
37-
run: make -j $(nproc)
38-
39-
# Windows MSVC
40-
- name: Install Boost
41-
if: matrix.os == 'windows-latest'
42-
uses: MarkusJx/[email protected]
43-
id: install-boost
44-
with:
45-
boost_version: 1.73.0
46-
toolset: msvc14.2
47-
48-
- name: Configure CMake Using MSVC
49-
if: matrix.os == 'windows-latest'
50-
env:
51-
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
52-
working-directory: ${{github.workspace}}/build
53-
shell: cmd
54-
run: |
55-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
56-
cmake .. . -G "NMake Makefiles"
57-
58-
- name: Build WebUI Using MSVC
59-
if: matrix.os == 'windows-latest'
60-
working-directory: ${{github.workspace}}/build
61-
shell: cmd
62-
run: |
63-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
64-
nmake
52+
steps:
53+
- uses: actions/checkout@v2
54+
55+
- name: Cache Boost
56+
uses: actions/cache@v2
57+
with:
58+
path: '${{ runner.workspace }}/boost_*.tar.gz'
59+
key: 'boost-${{env.BOOST_VER}}'
60+
61+
- name: Build Boost
62+
id: boost
63+
uses: egor-tensin/build-boost@v1
64+
with:
65+
version: ${{env.BOOST_VER}}
66+
libraries: ${{env.BOOST_LIBS}}
67+
platform: x64
68+
configuration: ${{env.BUILD_TYPE}}
69+
toolset: mingw
70+
static: 1
71+
static-runtime: 1
72+
directory: ${{github.workspace}}/boost
73+
74+
- name: Create Build Environment
75+
run: cmake -E make_directory ${{github.workspace}}/build
76+
77+
- name: Configure CMake
78+
env:
79+
BOOST_ROOT: ${{steps.boost.outputs.root}}
80+
BOOST_LIBRARYDIR: ${{steps.boost.outputs.librarydir}}
81+
working-directory: ${{github.workspace}}/build
82+
shell: cmd
83+
run: |
84+
cmake ${{github.workspace}} -G "MinGW Makefiles"
85+
86+
- name: Build
87+
working-directory: ${{github.workspace}}/build
88+
shell: cmd
89+
run: |
90+
mingw32-make
91+
92+
MSVC-Windows:
93+
runs-on: windows-latest
94+
95+
steps:
96+
- uses: actions/checkout@v2
97+
98+
- name: Cache Boost
99+
uses: actions/cache@v2
100+
with:
101+
path: '${{ runner.workspace }}/boost_*.tar.gz'
102+
key: 'boost-${{env.BOOST_VER}}'
103+
104+
- name: Build Boost
105+
id: boost
106+
uses: egor-tensin/build-boost@v1
107+
with:
108+
version: ${{env.BOOST_VER}}
109+
libraries: ${{env.BOOST_LIBS}}
110+
platform: x64
111+
configuration: ${{env.BUILD_TYPE}}
112+
toolset: msvc142
113+
static: 1
114+
static-runtime: 1
115+
directory: ${{github.workspace}}/boost
116+
117+
- name: Create Build Environment
118+
run: cmake -E make_directory ${{github.workspace}}/build
119+
120+
- name: Configure CMake
121+
env:
122+
BOOST_ROOT: ${{steps.boost.outputs.root}}
123+
BOOST_LIBRARYDIR: ${{steps.boost.outputs.librarydir}}
124+
working-directory: ${{github.workspace}}/build
125+
shell: cmd
126+
run: |
127+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
128+
cmake ${{github.workspace}} -G "NMake Makefiles"
129+
130+
- name: Build
131+
working-directory: ${{github.workspace}}/build
132+
shell: cmd
133+
run: |
134+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
135+
nmake

0 commit comments

Comments
 (0)