Skip to content

Build

Build #7

Workflow file for this run

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-11", 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