-
Notifications
You must be signed in to change notification settings - Fork 65
44 lines (42 loc) · 1.59 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
name: Build
on: workflow_dispatch
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: Build on ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: "ubuntu-20.04", build-dir: "build-linux" }
- { os: "windows-2019", build-dir: "build-windows" }
- { os: "macos-12", build-dir: "build-macos" }
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- name: Create Build Directory
run: |
mkdir -p ${{ matrix.config.build-dir }}
- name: Generate
working-directory: ./${{ matrix.config.build-dir }}
run: |
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DOPENVDB_CORE_SHARED=OFF -DTBB_TEST=OFF -DCMAKE_CXX_FLAGS="-fPIC ${{ matrix.config.build-dir == 'build-linux' && '-static-libgcc -static-libstdc++' || '' }} ${{ matrix.config.build-dir == 'build-windows' && '/MT /EHsc' || '' }}"
- name: Build
working-directory: ./${{ matrix.config.build-dir }}
run: |
cmake --build . --target main --config Release
# - name: Run `make`
# working-directory: ./${{ matrix.config.build-dir }}
# run: |
# make main -j2
- name: List Build Results
run: |
ls ${{ matrix.config.build-dir }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.os }}-build-main
path: |
./${{ matrix.config.build-dir }}/**/main
./${{ matrix.config.build-dir }}/**/main.exe