Skip to content

Redesign the build test CI jobs #400

Redesign the build test CI jobs

Redesign the build test CI jobs #400

Workflow file for this run

# This file is part of covfie, a part of the ACTS project
#
# Copyright (c) 2022 CERN
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
name: Build Tests
on: [ push, pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
linux-core:
strategy:
matrix:
BUILD:
- "Release"
- "Debug"
CXX_STANDARD:
- 20
COMPILER:
- NAME: "gcc"
CXX: "g++"
- NAME: "clang"
CXX: "clang++"
name: "Linux/Core/${{ matrix.BUILD }}/${{ matrix.COMPILER.NAME }}/C++${{ matrix.CXX_STANDARD }}"
runs-on: "ubuntu-latest"
container: ubuntu:24.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: apt-get update && apt-get -y install
libboost-filesystem-dev
libboost-program-options-dev
libboost-log-dev
wget
cmake
libbenchmark-dev
g++
clang
- name: Install Google Test
run: |
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
tar -xzvf v1.14.0.tar.gz
cmake -S googletest-1.14.0 -B gtest_build -DBUILD_GMOCK=Off -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/.prefixes/gtest/
cmake --build gtest_build -- -j $(nproc)
cmake --install gtest_build
- name: Configure
run: cmake
-DCMAKE_CXX_COMPILER=$(which ${{ matrix.COMPILER.CXX }})
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD }}
-DCOVFIE_REQUIRE_CXX20=${{ matrix.CXX_STANDARD == 20 && 'On' || 'Off' }}
-DCOVFIE_FAIL_ON_WARNINGS=TRUE
-DCOVFIE_BUILD_TESTS=On
-DCOVFIE_BUILD_EXAMPLES=On
-DCOVFIE_BUILD_BENCHMARKS=On
-DCOVFIE_TEST_HEADERS=On
-DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }}
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/.prefixes/gtest/"
-S $GITHUB_WORKSPACE
-B build
- name: Build
run: cmake --build build -- -j $(nproc)
- name: Core tests
run: build/tests/core/test_core
- name: CPU tests
run: build/tests/cpu/test_cpu
linux-cuda:
strategy:
matrix:
BUILD:
- "Release"
- "Debug"
CXX_STANDARD:
- 20
COMPILER:
- NAME: "gcc"
CXX: "g++"
CUDA_COMPILER:
- NAME: "nvcc"
CUDACC: "nvcc"
name: "Linux/CUDA/${{ matrix.BUILD }}/${{ matrix.COMPILER.NAME }}+${{ matrix.CUDA_COMPILER.NAME }}/C++${{ matrix.CXX_STANDARD }}"
runs-on: "ubuntu-latest"
container: ubuntu:24.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: apt-get update && apt-get -y install
libboost-filesystem-dev
libboost-program-options-dev
libboost-log-dev
wget
cmake
libbenchmark-dev
g++-10
clang
nvidia-cuda-toolkit
- name: Install Google Test
run: |
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
tar -xzvf v1.14.0.tar.gz
cmake -S googletest-1.14.0 -B gtest_build -DBUILD_GMOCK=Off -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/.prefixes/gtest/
cmake --build gtest_build -- -j $(nproc)
cmake --install gtest_build
- name: Configure
run: cmake
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD }}
-DCMAKE_CUDA_ARCHITECTURES=52
-DCMAKE_CUDA_HOST_COMPILER=$(which g++-10)
-DCOVFIE_FAIL_ON_WARNINGS=TRUE
-DCOVFIE_BUILD_TESTS=On
-DCOVFIE_BUILD_EXAMPLES=On
-DCOVFIE_BUILD_BENCHMARKS=On
-DCOVFIE_PLATFORM_CUDA=On
-DCOVFIE_PLATFORM_CPU=On
-DCOVFIE_TEST_HEADERS=On
-DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }}
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/.prefixes/gtest/"
-S $GITHUB_WORKSPACE
-B build
- name: Build
run: cmake --build build -- -j $(nproc)
- name: Core tests
run: build/tests/core/test_core
- name: CPU tests
run: build/tests/cpu/test_cpu
windows-core:
strategy:
matrix:
BUILD:
- "Release"
- "Debug"
CXX_STANDARD:
- 20
name: "Windows/Core/${{ matrix.BUILD }}/MSVC/C++${{ matrix.CXX_STANDARD }}"
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v3
- name: Install Google Test
run: |
Invoke-WebRequest -Uri "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" -OutFile "gtest.tar.gz"
tar -xf gtest.tar.gz
cmake -S .\googletest-1.14.0 -B .\gtest_build -Dgtest_force_shared_crt=On -DBUILD_GMOCK=Off
cmake --build .\gtest_build -j $NUMBER_OF_PROCESSORS --config ${{ matrix.BUILD }}
cmake --install .\gtest_build --config ${{ matrix.BUILD }} --prefix ${{ github.workspace }}\.prefix
- name: Install Google Benchmark
run: |
Invoke-WebRequest -Uri "https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz" -OutFile "gbench.tar.gz"
tar -xf gbench.tar.gz
cmake -S .\benchmark-1.8.3 -B .\gbench_build -DCMAKE_PREFIX_PATH=${{ github.workspace }}\.prefix -DBENCHMARK_ENABLE_TESTING=Off
cmake --build .\gbench_build -j $NUMBER_OF_PROCESSORS --config ${{ matrix.BUILD }}
cmake --install .\gbench_build --config ${{ matrix.BUILD }} --prefix ${{ github.workspace }}\.prefix
- name: Install Boost
run: |
Invoke-WebRequest -Uri "https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz" -OutFile "boost.tar.gz"
tar -xf boost.tar.gz
cd boost_1_83_0
.\bootstrap.bat
.\b2 install --with-log --with-program_options --prefix="${{ github.workspace }}\.prefix" -j $NUMBER_OF_PROCESSORS
- name: Configure
run: cmake
-DCOVFIE_FAIL_ON_WARNINGS=TRUE
-DCOVFIE_BUILD_TESTS=On
-DCOVFIE_BUILD_EXAMPLES=On
-DCOVFIE_BUILD_BENCHMARKS=On
-DCOVFIE_PLATFORM_CPU=On
-DCOVFIE_QUIET=On
-DCOVFIE_TEST_HEADERS=On
-DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }}
-DCMAKE_PREFIX_PATH="${{ github.workspace }}\.prefix"
-S ${{ github.workspace }}
-B build
- name: Build
run: cmake --build build -j $NUMBER_OF_PROCESSORS --config ${{ matrix.BUILD }}
- name: Core tests
run: .\build\tests\core\${{ matrix.BUILD}}\test_core.exe
- name: CPU tests
run: .\build\tests\cpu\${{ matrix.BUILD}}\test_cpu.exe