-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.74 KB
/
build-and-test.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
name: build-and-test
on: ["push", "pull_request"]
jobs:
build-and-test:
strategy:
matrix:
config:
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"}
- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"}
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: "noninteractive"
run: sudo apt-get update && sudo apt-get install -y build-essential pkg-config cmake ffmpeg imagemagick lcov libavformat-dev libexiv2-dev libgtest-dev libimage-exiftool-perl libjpeg-turbo-progs librange-v3-dev libspdlog-dev libturbojpeg0-dev
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build and test
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
cmake -B ${BUILD_DIR} -DENABLE_CLI=OFF -DENABLE_QT=OFF -DENABLE_TEST=ON
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
ctest --test-dir ${BUILD_DIR} -V
- name: Generate coverage report
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build-coverage/"
run: |
cmake -B ${BUILD_DIR} -DENABLE_CLI=OFF -DENABLE_QT=OFF -DENABLE_TEST_COVERAGE=ON
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
cmake --build ${BUILD_DIR} --target coverage
if: matrix.config.CC == 'gcc'
- name: Publish coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
path-to-lcov: build-coverage/coverage/trace.info
if: matrix.config.CC == 'gcc'