testing the build of the library with multiple #16
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: 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 }} |