Repository navigation
55 lines (44 loc) · 1.75 KB
/
Copy pathcmake.yml
File metadata and controls
55 lines (44 loc) · 1.75 KB
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
name: CMake Build and Test
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build_type: [Release, Debug]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install BLAS (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libopenblas-dev
- name: Install OpenBLAS (Windows)
if: runner.os == 'Windows'
run: vcpkg install openblas:x64-windows
- name: Configure CMake
run: >
cmake -B build -S .
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_VERBOSE_MAKEFILE=ON
${{ runner.os == 'Windows' && '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
- name: Run tests
run: cd build && ctest -C ${{ matrix.build_type }} --verbose
# The library must also configure, build and test on its own, with no engine
# around it: that is what lets it move to its own repository.
- name: Configure sparsediff_linalg standalone
run: >
cmake -B build-standalone -S sparsediff_linalg
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
${{ runner.os == 'Windows' && '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }}
- name: Build sparsediff_linalg standalone
run: cmake --build build-standalone --config ${{ matrix.build_type }}
- name: Test sparsediff_linalg standalone
run: ctest --test-dir build-standalone -C ${{ matrix.build_type }} --output-on-failure