-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.87 KB
/
ci.yml
File metadata and controls
66 lines (55 loc) · 1.87 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
56
57
58
59
60
61
62
63
64
65
66
name: CI
on:
push:
branches: [ main, dev ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.os == 'windows-latest' && 30 || 20 }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
u8string: [ON, OFF]
env:
BUILD_DIR: cmake-build-${{ matrix.u8string }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache CMake build
uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR }}
key: ${{ runner.os }}-cmake-${{ matrix.u8string }}-${{ hashFiles('**/CMakeLists.txt') }}
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Configure
shell: bash
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
# Use MSVC on Windows
cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=Debug -DERBSLAND_RE_ENABLE_TESTS=ON -DERBSLAND_RE_U8STRING=${{ matrix.u8string }}
else
cmake -S . -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=Debug -DERBSLAND_RE_ENABLE_TESTS=ON -DERBSLAND_RE_U8STRING=${{ matrix.u8string }}
fi
- name: Build
run: cmake --build ${{ env.BUILD_DIR }} --config Debug --parallel
- name: Run tests
shell: bash
run: |
cd ${{ env.BUILD_DIR }}
ctest --output-on-failure -C Debug