This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (76 loc) · 3.05 KB
/
main.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: friendlyanon/setup-vcpkg@v1 # needs to be after checkout or else it's deleted
with:
committish: db0473513e5dc73ec6b6f431ff05d2f398eea042
- if: matrix.os == 'windows-latest' # Because windows is still x86 by default
shell: bash # access regardless of the host operating system
run: $VCPKG_ROOT/vcpkg install eigen3 gtest --triplet=x64-windows
- if: matrix.os != 'windows-latest'
run: $VCPKG_ROOT/vcpkg install eigen3 gtest
- run: cmake -E make_directory ${{ github.workspace }}/build
- name: configure
shell: bash
working-directory: ${{ github.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
- name: build
shell: bash
working-directory: ${{ github.workspace }}/build
run: cmake --build .
- name: test
shell: bash
working-directory: ${{ github.workspace }}/build
run: ctest . --build-config Debug --rerun-failed --output-on-failure
install:
runs-on: ${{ matrix.os }}
env:
CMAKE_BUILD_TYPE: Release
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: friendlyanon/setup-vcpkg@v1 # needs to be after checkout or else it's deleted
with:
committish: db0473513e5dc73ec6b6f431ff05d2f398eea042
- if: matrix.os == 'windows-latest' # Because windows is still x86 by default
shell: bash # access regardless of the host operating system
run: $VCPKG_ROOT/vcpkg install eigen3 gtest --triplet=x64-windows
- if: matrix.os != 'windows-latest'
run: $VCPKG_ROOT/vcpkg install eigen3 gtest
- run: cmake -E make_directory ${{ github.workspace }}/build
- if: matrix.os != 'windows-latest'
name: setup
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTING=OFF
cmake --build .
sudo cmake --install .
# No sudo and it's multi config
- if: matrix.os == 'windows-latest'
name: setup
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTING=OFF
cmake --build . --config Release
cmake --install . --config Release
- name: examples
shell: bash
working-directory: ${{ github.workspace }}/examples
run: |
cmake . --debug-find -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release