-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (37 loc) · 1.14 KB
/
cmake-run-tests.yaml
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
name: CI testing
on: [push]
jobs:
run-tests:
# Target OS: Ubuntu.
runs-on: ubuntu-latest
# Use bash for all commands.
defaults:
run:
shell: bash
# Set of commands to be run.
steps:
# Install CMake and other dependencies (if any!).
- name: Install dependencies
working-directory: ${{github.workspace}}
run: sudo apt install cmake
# Clone the repository.
- uses: actions/checkout@v2
# Install GTest using the script from this repo
- name: Install GTest
run: sh .github/workflows/install-gtest.sh
# Create the build space.
- name: Create build directory
working-directory: ${{github.workspace}}
run: mkdir ${{github.workspace}}/build
# Configure CMake.
- name: Invoke CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DBUILD_TESTS=ON -DBUILD_DOC=OFF
# Build the code (tests included!).
- name: Build code and tests
working-directory: ${{github.workspace}}/build
run: cmake --build .
# Run the generated tests
- name: Run tests
working-directory: ${{github.workspace}}/build
run: ctest --verbose