-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.2 KB
/
build.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 pipeline
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
jobs:
build-test-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up gcov and lcov
run: |
pip install gcovr
- name: Run tests
run: |
cmake -DENABLE_COVERAGE=ON . make
- name: Generate gcovr report
run: |
mkdir coverage_report/
gcovr --root . --html --html-details -o coverage_report/coverage.html
- uses: actions/upload-artifact@v4
with:
retention-days: 1
if-no-files-found: error
name: coverage-report
path: coverage_report/
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
build-args: GIT_COMMIT=${{ github.sha }}
tags: jerilok/cpp-build-test:${{ github.sha }}