forked from hgarrereyn/SBVA
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: binary build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
build: | ||
# The CMake configure and build commands are platform agnostic and should work equally | ||
# well on Windows or Mac. You can convert this to a matrix build if you need | ||
# cross-platform coverage. | ||
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix | ||
runs-on: ${{ matrix.os }} | ||
|
||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2022, macos-13] | ||
build_type: ['Release'] | ||
staticcompile: ['ON', 'OFF'] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
||
# install dependencies | ||
- name: Install boost & help2man for Linux | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libboost-serialization-dev libboost-program-options-dev help2man | ||
|
||
- name: Configure CMake for linux | ||
if: matrix.os == 'ubuntu-20.04' | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
#working-directory: ${{runner.workspace}}/build | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTING=ON -DSTATICCOMPILE=${{ matrix.staticcompile }} | ||
|
||
- name: Configure CMake for non-linux | ||
if: matrix.os != 'ubuntu-20.04' | ||
# Use a bash shell so we can use the same syntax for environment variable | ||
# access regardless of the host operating system | ||
#working-directory: ${{runner.workspace}}/build | ||
# Note the current convention is to use the -S and -B options here to specify source | ||
# and build directories, but this is only available with CMake 3.13 and higher. | ||
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | ||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTING=OFF -DSTATICCOMPILE=${{ matrix.staticcompile }} | ||
|
||
- name: Build | ||
#working-directory: ${{runner.workspace}}/build | ||
# Execute the build. You can specify a specific target with "--target <NAME>" | ||
run: cmake --build . --config ${{ matrix.build_type }} | ||
|
||
- name: Test | ||
#working-directory: ${{runner.workspace}}/build | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C ${{ matrix.build_type }} | ||
|
||
- name: Upload Artifact - Linux | ||
if: matrix.os == 'ubuntu-20.04' && matrix.staticcompile == 'ON' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sbva-linux-amd64 | ||
path: sbva | ||
|
||
- name: Upload Artifact - Mac | ||
if: matrix.os == 'macos-13' && matrix.staticcompile == 'ON' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sbva-mac-amd64 | ||
path: sbva | ||
|
||
- name: Upload Artifact - Windows | ||
if: matrix.os == 'windows-2022' && matrix.staticcompile == 'ON' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: sbva-win64.exe | ||
path: Release\sbva.exe |