Skip to content

Workflow update

Workflow update #31

Workflow file for this run

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 }}