Build application #17
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 application | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
ubuntu-gcc-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y cmake ninja-build ccache scons | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }} | |
create-symlink: true | |
- name: Configure | |
run: > | |
cmake -S . -B build | |
-GNinja | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
- name: Build | |
run: | | |
cmake --build build --parallel | |
ubuntu-clang-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y cmake ninja-build ccache scons | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }} | |
create-symlink: true | |
- name: Configure | |
run: > | |
cmake -S . -B build | |
-GNinja | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
- name: Build | |
run: | | |
cmake --build build --parallel | |
macos-clang-build: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
brew install ninja scons | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }} | |
create-symlink: true | |
- name: Configure | |
run: > | |
cmake -S . -B build | |
-GNinja | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
- name: Build | |
run: | | |
cmake --build build --parallel | |
ubuntu-gcc-build-codecov: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y cmake ninja-build ccache gcovr lcov scons | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }} | |
create-symlink: true | |
- name: Configure | |
run: > | |
cmake -S . -B build | |
-GNinja | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
-DCMAKE_C_FLAGS="--coverage" | |
-DCMAKE_CXX_FLAGS="--coverage" | |
- name: Build | |
run: | | |
cmake --build build --parallel | |
- name: Test | |
run: | | |
build/bin/run_tests | |
env: | |
CTEST_OUTPUT_ON_FAILURE: 1 | |
- name: Generate lcov Coverage Data | |
run: | | |
cd build | |
lcov --capture --directory . --output-file ../coverage.info | |
lcov --remove ../coverage.info '*/3rdparty/*' '/usr/*' '*/test/*' --output-file ../coverage.info | |
cd .. | |
genhtml coverage.info --output-directory cov-report | |
continue-on-error: true | |
- name: Upload coverage report artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cov-report | |
path: 'cov-report' | |
- name: Generate gcovr Coverage Data | |
run: | | |
cd build | |
gcovr -r ../ --xml --output ../coverage.xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml |