Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup Dependencies
description: Setup spack and install dependencies

inputs:
gcc:
description: 'GCC version to use'
required: true
fresh:
description: 'Use fresh concretization'
default: 'false'

runs:
using: composite
steps:
- name: Setup spack
uses: spack/setup-spack@v2
with:
ref: v1.1.0
color: true
buildcache: true

- name: Install GCC
shell: spack-bash {0}
run: |
spack install gcc@${{ inputs.gcc }}
spack compiler find $(spack location -i gcc@${{ inputs.gcc }})

- name: Install dependencies
shell: spack-bash {0}
run: |
spack env create fairmq test/ci/spack.yaml
spack -e fairmq add gcc@${{ inputs.gcc }}
spack -e fairmq config add "packages:all:require:'%gcc@${{ inputs.gcc }}'"
spack -e fairmq install --fail-fast ${{ inputs.fresh == 'true' && '--fresh' || '' }}
spack env activate --sh fairmq | grep '^export ' | sed 's/^export //;s/;$//' >> $GITHUB_ENV
42 changes: 42 additions & 0 deletions .github/workflows/buildcache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Spack Buildcache

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 0' # Weekly on Sunday at 3am UTC
push:
paths:
- 'test/ci/spack.yaml'
- '.github/workflows/buildcache.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: github.repository == 'FairRootGroup/FairMQ'
name: gcc-${{ matrix.gcc }}
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
gcc: ['12', '13', '14', '15']

env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-deps
with:
gcc: ${{ matrix.gcc }}
fresh: true

- name: Push to buildcache
if: ${{ !cancelled() }}
run: spack buildcache push --unsigned --update-index local-buildcache
126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI

on:
push:
branches: [master, dev]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: github.repository == 'FairRootGroup/FairMQ'
name: gcc-${{ matrix.gcc }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
gcc: ['12', '13', '14', '15']

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-tags: true
fetch-depth: 0

- uses: ./.github/actions/setup-deps
with:
gcc: ${{ matrix.gcc }}

- name: Configure and Build
uses: threeal/cmake-action@v2
with:
generator: Ninja
options: |
CMAKE_BUILD_TYPE=RelWithDebInfo
CMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
BUILD_TESTING=ON

- name: Test
uses: threeal/ctest-action@v1
with:
test-dir: build

- name: Install
run: cmake --install build

sanitizers:
if: github.repository == 'FairRootGroup/FairMQ'
name: ${{ matrix.sanitizer.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer:
- name: asan+lsan+ubsan
options: |
ENABLE_SANITIZER_ADDRESS=ON
ENABLE_SANITIZER_LEAK=ON
ENABLE_SANITIZER_UNDEFINED_BEHAVIOUR=ON
cxx-flags: -O1 -fno-omit-frame-pointer
- name: tsan
options: ENABLE_SANITIZER_THREAD=ON
cxx-compiler: clang++

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-tags: true
fetch-depth: 0

- uses: ./.github/actions/setup-deps
with:
gcc: '14'

- name: Configure and Build
uses: threeal/cmake-action@v2
with:
generator: Ninja
cxx-compiler: ${{ matrix.sanitizer.cxx-compiler }}
cxx-flags: ${{ matrix.sanitizer.cxx-flags }}
options: |
CMAKE_BUILD_TYPE=Debug
BUILD_TESTING=ON
${{ matrix.sanitizer.options }}

- name: Test
uses: threeal/ctest-action@v1
with:
test-dir: build

static-analysis:
if: github.repository == 'FairRootGroup/FairMQ'
name: static-analysis
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-tags: true
fetch-depth: 0

- uses: ./.github/actions/setup-deps
with:
gcc: '14'

- name: Configure and Build
uses: threeal/cmake-action@v2
with:
generator: Ninja
options: |
CMAKE_BUILD_TYPE=Debug
BUILD_TESTING=ON
RUN_STATIC_ANALYSIS=ON

- name: Check for warnings
run: |
if grep -q "warning:" build.log; then
echo "::warning::Static analysis found warnings"
grep "warning:" build.log
exit 1
fi
93 changes: 0 additions & 93 deletions FairMQTest.cmake

This file was deleted.

Loading
Loading