-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (59 loc) · 2.12 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
os: [linux, windows, macos]
build_type: [Debug, RelWithDebInfo]
arch: [x86, x64]
cmake: [minimal, latest]
exclude:
- os: linux
arch: x86
- os: windows
cmake: minimal
- os: macos
arch: x86
- os: macos
cmake: minimal
include:
- cmake: minimal
cmake_url_part: v3.5/cmake-3.5.2
- os: linux
runner: ubuntu-latest
- os: windows
runner: windows-latest
- os: windows
arch: x86
cmake_args: -A Win32
- os: windows
arch: x64
cmake_args: -A x64
- os: macos
runner: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install dependencies (linux)
if: matrix.os == 'linux'
run: |
set -ex
cmake_url="https://cmake.org/files"
cmake_url_part="${{ matrix.cmake_url_part }}"
if [ -n "$cmake_url_part" ]; then
cmake_url_part="${cmake_url_part}-Linux-x86_64.tar.gz"
else
cmake_url_part="LatestRelease/$(wget --quiet --no-check-certificate "${cmake_url}/LatestRelease/cmake-latest-files-v1.json" -O - | jq -r '[.files[] | select(.class == "archive" and (.os[] | contains("linux")) and (.architecture[] | contains("x86_64")))] | .[0] | .name')"
fi
wget --no-check-certificate "${cmake_url}/${cmake_url_part}" -O /tmp/cmake.tar.gz
sudo tar xf /tmp/cmake.tar.gz -C /usr/local --strip-components 1
- name: CMake version
run: cmake --version
- name: Configure
run: cmake -E make_directory _build && cmake -E chdir _build cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_args }}
- name: Build
run: cmake --build _build --config ${{ matrix.build_type }}
- name: Test
run: cmake -E chdir _build ctest --build-config ${{ matrix.build_type }} --output-on-failure