-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.48 KB
/
ci.yml
File metadata and controls
64 lines (50 loc) · 1.48 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
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ lcov
- name: Compile tests with coverage
run: |
g++ -std=c++11 --coverage -fprofile-arcs -ftest-coverage tests.cpp -o tests
- name: Run tests
run: ./tests
- name: Generate coverage report
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
test-multiple-platforms:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
compiler: [g++, clang++]
exclude:
- os: windows-latest
compiler: clang++
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Compile tests (Unix)
if: matrix.os != 'windows-latest'
run: |
${{ matrix.compiler }} -std=c++11 tests.cpp -o tests
- name: Compile tests (Windows)
if: matrix.os == 'windows-latest'
run: |
g++ -std=c++11 tests.cpp -o tests.exe
- name: Run tests (Unix)
if: matrix.os != 'windows-latest'
run: ./tests
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: ./tests.exe