-
Notifications
You must be signed in to change notification settings - Fork 137
122 lines (111 loc) · 4.6 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
name: Build and Test
on:
pull_request:
push:
release:
types:
- created
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-20.04, windows-latest]
include:
- os: ubuntu-20.04
build_type: Debug
config_flags: "-DUSE_ASAN=ON"
deps: libasan6
- os: windows-latest
build_type: Debug
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- if: contains(matrix.os, 'ubuntu')
name: Get Dependencies
run: |
sudo apt-get update
sudo apt-get install p7zip-full build-essential zlib1g-dev libx11-dev libusb-1.0-0-dev freeglut3-dev liblapacke-dev libopenblas-dev libatlas-base-dev libpcap-dev python3 python3-pip apt-transport-https dotnet-sdk-3.1 libpcap-dev ninja-build libeigen3-dev ${{ matrix.deps }}
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup windows flags
if: contains(matrix.os, 'windows') && matrix.build_type == 'Release'
id: flags
run: echo "::set-output name=SETUP_PY_FLAGS::-G 'Visual Studio 16 2019'"
- name: Get mac dependencies
if: contains(matrix.os, 'macos')
run: |
brew install freeglut lapack libusb openblas
brew info libusb
brew ls libusb
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
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 -DUSE_EIGEN=On -DDOWNLOAD_EIGEN=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_TESTS=ON -DCMAKE_INSTALL_PREFIX=install_root ${{matrix.config_flags}}
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE -v
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --target install
- name: Set bundle name
id: bundle
run: echo "::set-output name=BUNDLE_FILE_NAME::libsurvive-$(git describe --tags)-${{ matrix.os }}.zip"
- name: Bundle
if: matrix.build_type == 'Release'
working-directory: ${{runner.workspace}}/libsurvive
run: 7z a ${{runner.workspace}}/build/${{ steps.bundle.outputs.BUNDLE_FILE_NAME }} ${{runner.workspace}}/build/install_root/*
- uses: actions/upload-artifact@v2
name: Upload
if: matrix.build_type == 'Release'
with:
name: libsurvive-${{ matrix.os }}-${{ matrix.build_type }}
path: |
${{runner.workspace}}/build/${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
${{runner.workspace}}/libsurvive/dist/*.whl
- name: Get release
id: get_release
if: github.event_name == 'release'
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
id: upload-release-asset
continue-on-error: true
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{runner.workspace}}/build/${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
asset_name: ${{steps.bundle.outputs.BUNDLE_FILE_NAME}}
asset_content_type: application/zip
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE --output-on-failure -j30
env:
LSAN_OPTIONS: suppressions=${{runner.workspace}}/libsurvive/useful_files/leak_suppressions.txt