Skip to content

Commit

Permalink
Refactor CICD pipeline to build on Ubuntu distros (#58)
Browse files Browse the repository at this point in the history
* Add debian build

* Update pipeline

* Combine debug and release into the same pipeline

* fix pipeline

* Test debian only

* Test debian only

* Update ubuntu pipeline

* fix build ubuntu
  • Loading branch information
lucasle-sn authored Jan 3, 2025
1 parent 2113d66 commit 55323eb
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Pipeline
name: Build Ubuntu Pipeline

on:
push:
Expand All @@ -10,20 +10,18 @@ on:

env:
BUILD_DEPENDENCIES: cmake build-essential checkinstall zlib1g-dev libssl-dev libfmt-dev
BUILD_DIRECTORY: build

jobs:
build-ubuntu:
build:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
build-type: ["Debug", "Release"]
compiler: [
{ c: "gcc-11", cxx: "g++-11", package: "gcc-11 g++-11" },
{ c: "clang-14", cxx: "clang++-14", package: "clang-14" }
]
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} / ${{ matrix.build-type }} / ${{ matrix.compiler.cxx }}
name: Build ${{ matrix.os }} / ${{ matrix.compiler.cxx }}
timeout-minutes: 30
steps:
- name: Checkout code
Expand All @@ -32,7 +30,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Install dependencies
- name: Install dependencies Ubuntu-20.04
if: matrix.os == 'ubuntu-20.04'
run: |
if [[ "${{ matrix.compiler.c }}" == "gcc-11" ]]; then
Expand All @@ -53,22 +51,28 @@ jobs:
sudo apt-get update && \
sudo apt-get install -y ${{ env.BUILD_DEPENDENCIES }} ${{ matrix.compiler.package }}
- name: Build
- name: Build and Test
run: |
cmake -S . -B ${{ env.BUILD_DIRECTORY }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
cmake --build ${{ env.BUILD_DIRECTORY }} -j10
buildTypes=("debug" "release")
for buildType in "${buildTypes[@]}"; do
export BUILD_DIRECTORY=build/$buildType
cmake -S . -B $BUILD_DIRECTORY \
-DCMAKE_BUILD_TYPE=$buildType \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}
cmake --build $BUILD_DIRECTORY -j10
done
- name: Test
run: cd ${{ env.BUILD_DIRECTORY }} && ctest -j8 -T test --no-compress-output
run: |
export BUILD_DIRECTORY=build/release
cd $BUILD_DIRECTORY && ctest -j8 -T test --no-compress-output
clang-format-check:
name: Clang-format Check
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [build-ubuntu]
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit 55323eb

Please sign in to comment.