Skip to content

Commit

Permalink
ci: update ubuntu ci
Browse files Browse the repository at this point in the history
Run jobs in parallel and build on multiple versions of GCC and Clang
  • Loading branch information
DeveloperPaul123 committed Apr 11, 2024
1 parent f47aa92 commit 808d371
Showing 1 changed file with 59 additions and 38 deletions.
97 changes: 59 additions & 38 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,67 @@ env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules

jobs:
build:

build-gcc:
name: "gcc-${{ matrix.version }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 4

env:
CPP_STANDARD: 20
strategy:
fail-fast: false
matrix:
version: [11]
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}

- name: set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: ${{matrix.version}}
platform: x64

- name: configure gcc
run: cmake -S . -B build -DTP_BUILD_EXAMPLES=OFF -DTP_BUILD_BENCHMARKS=OFF -DTP_THREAD_SANITIZER=OFF -DCMAKE_BUILD_TYPE=Debug

- name: build
run: cmake --build build -j4

- name: test
run: |
cd build
ctest --build-config Debug
- name: Set up coverage tools
run: |
sudo apt-get install lcov gcovr -y
- name: Generate coverage report
working-directory: ${{github.workspace}}/build/test/CMakeFiles/thread-pool-tests.dir
run: |
lcov --directory . --capture --gcov gcov-11 --output-file coverage.info
lcov --remove coverage.info '*/test/*' --output-file coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ${{github.workspace}}/build/test/CMakeFiles/thread-pool-tests.dir/coverage.info

build-clang:
name: "clang-${{matrix.version}}"
runs-on: ubuntu-20.04
env:
CPP_STANDARD: 20
strategy:
fail-fast: false
max-parallel: 4
matrix:
version: [14, 15]

steps:
- uses: actions/checkout@v3

Expand All @@ -33,50 +85,19 @@ jobs:
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: 14
version: ${{ matrix.version }}
platform: x64

- name: set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: configure gcc
run: cmake -S . -B build -DTP_BUILD_EXAMPLES=OFF -DTP_BUILD_BENCHMARKS=OFF -DTP_THREAD_SANITIZER=OFF -DCMAKE_BUILD_TYPE=Debug

- name: configure clang
run: cmake -S . -B build-clang -DTP_BUILD_EXAMPLES=OFF -DTP_BUILD_BENCHMARKS=OFF -DTP_THREAD_SANITIZER=OFF -DCMAKE_BUILD_TYPE=Debug
env:
CC: clang
CXX: clang++

- name: build
run: |
cmake --build build -j4
cmake --build build-clang -j4
- name: test
run: |
cd build
ctest --build-config Debug
run: cmake --build build-clang -j4

- name: test clang
run: |
cd build-clang
ctest --build-config Debug
- name: Set up coverage tools
run: |
sudo apt-get install lcov gcovr -y
- name: Generate coverage report
working-directory: ${{github.workspace}}/build/test/CMakeFiles/thread-pool-tests.dir
run: |
lcov --directory . --capture --gcov gcov-11 --output-file coverage.info
lcov --remove coverage.info '*/test/*' --output-file coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: ${{github.workspace}}/build/test/CMakeFiles/thread-pool-tests.dir/coverage.info

0 comments on commit 808d371

Please sign in to comment.