-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.72 KB
/
cover.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
name: Coverage (GCC, Ubuntu)
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/configure-pages@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs.
# These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install build dependencies
run: |
# LLVM 17
wget https://apt.llvm.org/llvm.sh
chmod u+x ./llvm.sh
sudo ./llvm.sh 17
# Raylib and Gcovr
sudo apt install libasound2-dev libx11-dev libxrandr-dev \
libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev \
gcovr
- name: Configure CMake for Coverage
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_C_COMPILER=gcc
-DCOVERAGE=1
-DCMAKE_BUILD_TYPE=Debug
-S ${{ github.workspace }}
- name: Build the unit test executable (units)
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target units
- name: Run the unit tests
working-directory: "${{ steps.strings.outputs.build-output-dir }}"
run: ctest
- name: Apply Gcovr
run: gcovr --coveralls > coverage.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
token: ${{ secrets.CODECOV_TOKEN }}
slug: axionbuster/grass