Skip to content

Commit 71aac11

Browse files
committed
Add GitHub CI workflow
1 parent 2a4be75 commit 71aac11

3 files changed

Lines changed: 91 additions & 90 deletions

File tree

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master, dev ]
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
fedora: [38, 39, 40]
15+
include:
16+
- fedora: 38
17+
gcc: 13
18+
- fedora: 39
19+
gcc: 13
20+
- fedora: 40
21+
gcc: 14
22+
23+
container: ghcr.io/fairrootgroup/fairmq-dev/fedora-${{ matrix.fedora }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Install additional dependencies
29+
run: |
30+
dnf install -y fmt-devel || true
31+
32+
- name: Configure
33+
run: |
34+
cmake -B build -G Ninja \
35+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
36+
-DDISABLE_COLOR=ON \
37+
-DUSE_EXTERNAL_FMT=ON \
38+
-DUSE_BOOST_PRETTY_FUNCTION=ON
39+
40+
- name: Build
41+
run: cmake --build build
42+
43+
- name: Test
44+
run: |
45+
cd build
46+
ctest -V --output-on-failure
47+
48+
build-macos:
49+
runs-on: ${{ matrix.os }}
50+
strategy:
51+
matrix:
52+
os: [macos-13, macos-14, macos-15]
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Cache Homebrew packages
58+
uses: actions/cache@v4
59+
with:
60+
path: |
61+
~/Library/Caches/Homebrew
62+
/usr/local/Homebrew/Library/Taps
63+
key: ${{ runner.os }}-${{ matrix.os }}-brew-${{ hashFiles('.github/workflows/ci.yml') }}
64+
restore-keys: |
65+
${{ runner.os }}-${{ matrix.os }}-brew-
66+
67+
- name: Install dependencies
68+
run: |
69+
brew install cmake ninja boost fmt
70+
71+
- name: Configure
72+
run: |
73+
cmake -B build -G Ninja \
74+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
75+
-DDISABLE_COLOR=ON \
76+
-DUSE_EXTERNAL_FMT=ON \
77+
-DUSE_BOOST_PRETTY_FUNCTION=ON
78+
79+
- name: Build
80+
run: cmake --build build
81+
82+
- name: Test
83+
run: |
84+
cd build
85+
ctest -V --output-on-failure

FairLoggerTest.cmake

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@ set(CTEST_USE_LAUNCHERS ON)
1515
set(CTEST_CONFIGURATION_TYPE "RelWithDebInfo")
1616

1717
if(NOT NCPUS)
18-
if(ENV{SLURM_CPUS_PER_TASK})
19-
set(NCPUS $ENV{SLURM_CPUS_PER_TASK})
20-
else()
21-
include(ProcessorCount)
22-
ProcessorCount(NCPUS)
23-
if(NCPUS EQUAL 0)
24-
set(NCPUS 1)
25-
endif()
18+
include(ProcessorCount)
19+
ProcessorCount(NCPUS)
20+
if(NCPUS EQUAL 0)
21+
set(NCPUS 1)
2622
endif()
2723
endif()
2824

@@ -32,10 +28,10 @@ else()
3228
set(CTEST_SITE $ENV{CTEST_SITE})
3329
endif()
3430

35-
if ("$ENV{LABEL}" STREQUAL "")
31+
if ("$ENV{CTEST_BUILD_NAME}" STREQUAL "")
3632
set(CTEST_BUILD_NAME "build")
3733
else()
38-
set(CTEST_BUILD_NAME $ENV{LABEL})
34+
set(CTEST_BUILD_NAME $ENV{CTEST_BUILD_NAME})
3935
endif()
4036

4137
ctest_start(Continuous)

Jenkinsfile

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)