Workflow update #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |