forked from NLnetLabs/simdzone
-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (134 loc) · 4.95 KB
/
build-test.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: build-test
on: [ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# - os: ubuntu-22.04
# cc: gcc
# build_type: Debug
# build_tool_options: -j 4
# analyzer: off
# - os: ubuntu-22.04
# cc: clang
# build_type: Debug
# build_tool_options: -j 4
# analyzer: off
# sanitizer: address,undefined
# - os: macos-12
# packages: automake
# build_type: Debug
# build_tool_options: -j 4
# analyzer: off
# - os: windows-2022
# generator: "Visual Studio 17 2022"
# build_type: Debug
# build_tool_options: "-nologo -verbosity:minimal -maxcpucount:4 -p:CL_MPCount=4"
- os: windows-2022
cc: 'C:/mingw64/bin/gcc.exe'
generator: 'MinGW Makefiles'
build_type: Debug
steps:
- uses: actions/checkout@v4
# Use for SSH access
#- uses: mxschmitt/action-tmate@v3
# with:
# detached: true
- uses: actions/setup-python@v5
with:
python-version: '3.x' # use latest Python 3.x
- name: 'Add user site-packages to PATH'
if: runner.os != 'Windows'
shell: bash
run: |
echo "$(python3 -m site --user-base)/bin" >> $GITHUB_PATH
- name: 'Add user site-packages to PATH'
if: runner.os == 'Windows'
shell: pwsh
run: |
$python_base = python -m site --user-base
Write-Output "$python_base\\bin" >> $GITHUB_PATH
- name: 'Install macOS packages'
if: runner.os == 'macOS'
shell: bash
run: |
brew install ${{matrix.packages}}
- name: 'Install MSYS2 packages'
uses: msys2/setup-msys2@v2
if: runner.os == 'Windows' && matrix.generator == 'MinGW Makefiles'
with:
update: false
release: false
install: make gcc base-devel autotools autoconf-wrapper
- name: 'Workaround for actions/runner-images#9491'
if: runner.os == 'Linux'
run: sudo sysctl vm.mmap_rnd_bits=28
- name: 'Install Conan C/C++ package manager'
id: install_conan
shell: bash
env:
CC: ${{matrix.cc}}
# Set CONAN_BASH_PATH to avoid having to build msys2 for Conan packages.
CONAN_BASH_PATH: "C:\\msys64\\usr\\bin\\bash.exe"
run: |
pip install conan --user --upgrade
conan profile detect
conan_home=$(conan config home)
echo "conan_data=${conan_home}/p" >> $GITHUB_OUTPUT
- name: 'Restore Conan cache'
id: cache_conan
uses: actions/cache@v4
with:
key: conan | 1 | ${{runner.os}} | ${{matrix.cc}} | ${{matrix.build_type}}
path: ${{ steps.install_conan.outputs.conan_data }}
- name: 'Build simdzone'
id: build
shell: bash
env:
CC: ${{matrix.cc}}
ANALYZER: ${{matrix.analyzer}}
SANITIZER: ${{matrix.sanitizer}}
GENERATOR: ${{matrix.generator}}
BUILD_TYPE: ${{matrix.build_type}}
BUILD_TOOL_OPTIONS: ${{matrix.build_tool_options}}
WARNINGS_AS_ERRORS: ${{matrix.warnings_as_errors}}
CONAN_BASH_PATH: "C:\\msys64\\usr\\bin\\bash.exe"
run: |
set -e -x
mkdir build
cd build
conan install -b missing -s build_type=${BUILD_TYPE:-RelWithDebInfo} -of . ../conanfile.txt
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-RelWithDebInfo} \
-DCMAKE_COMPILE_WARNING_AS_ERROR=${WARNINGS_AS_ERRORS:-on} \
-DCMAKE_PREFIX_PATH=$(pwd) \
-DBUILD_TESTING=on \
-DANALYZER=${ANALYZER:-off} \
-DSANITIZER=${SANITIZER:-off} \
${GENERATOR:+-G} ${GENERATOR:+"${GENERATOR}"} ..
cmake --build . --config ${BUILD_TYPE:-RelWithDebInfo} -- ${BUILD_TOOL_OPTIONS}
- name: 'Run simdzone tests'
id: test
shell: bash
env:
BUILD_TYPE: ${{matrix.build_type}}
run: |
set -e -x
cd build
ctest -j 4 --output-on-failure -T test -C ${BUILD_TYPE:-RelWithDebInfo}
ZONE_KERNEL=fallback ctest -j 4 --output-on-failure -T test -C ${BUILD_TYPE:-RelWithDebInfo}
- name: Put MSYS2_MinGW64 on PATH
if: runner.os == 'Windows' && matrix.generator == 'MinGW Makefiles'
# there is not yet an environment variable for this path from msys2/setup-msys2
run: echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: 'Build simdzone with configure + make'
if: runner.os != 'Windows' || matrix.generator == 'MinGW Makefiles'
id: test_autoconf
shell: bash
run: |
set -e -x
echo $PATH
/usr/bin/autoreconf -i
./configure
make -j 2 || cat .depend