-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (133 loc) · 4.03 KB
/
pull_request.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Pull request
on:
pull_request:
push:
branches:
- develop
push:
branches:
- main
env:
COVERAGE_REPORT_DIR: build/coverage
MINIMUM_COVERAGE: 85
LD_PRELOAD: LD_PRELOAD=build/test/src/libc/libpreload.so
jobs:
build:
name: Build library
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, g++, clang]
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build library
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=${{ matrix.compiler }} -S . -B build
cmake --build build
build_samples:
name: Build samples
runs-on: ubuntu-latest
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build samples
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SAMPLES=ON -S . -B build
cmake --build build
unit_tests:
name: Run unit tests
runs-on: ubuntu-latest
needs: build
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build tests
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -S . -B build
cmake --build build
- name: Run unit tests
run: ${{ env.LD_PRELOAD }} build/test/pool-day-tests
dynamic_analysis:
name: Run dynamic analysis
runs-on: ubuntu-latest
needs: unit_tests
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build tests
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -S . -B build
cmake --build build
- name: Run valgrind
run: ${{ env.LD_PRELOAD }} valgrind --leak-check=full --error-exitcode=1 build/test/pool-day-tests
check_documentation:
name: Check documentation
runs-on: ubuntu-latest
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build library documentation
run: |
cmake -DBUILD_DOCUMENTATION=ON -S . -B build
cmake --build build
check_coverage:
name: Check test coverage
runs-on: ubuntu-latest
needs: unit_tests
container:
image: andrelcmoreira/pool-day:v2
volumes:
- ${{ github.workspace }}:/pool-day
credentials:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
steps:
- uses: actions/checkout@v2
- name: Build tests
run: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_UNIT_TESTS=ON -DBUILD_COVERAGE=ON -S . -B build
cmake --build build
- name: Generate coverage report
run: |
mkdir ${{ env.COVERAGE_REPORT_DIR }}
${{ env.LD_PRELOAD }} build/test/pool-day-tests
gcovr -r . -s --html --html-details \
--fail-under-line ${{ env.MINIMUM_COVERAGE }} \
-o ${{ env.COVERAGE_REPORT_DIR }}/pool-day.html
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: ${{ env.COVERAGE_REPORT_DIR }}