Skip to content

Bump oxsecurity/megalinter from 8.4.0 to 8.4.2 #113

Bump oxsecurity/megalinter from 8.4.0 to 8.4.2

Bump oxsecurity/megalinter from 8.4.0 to 8.4.2 #113

name: CMake using downloaded binary of ROOT
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
# cc: "gcc" or c_compiler: gcc? cxx: "g++" or cpp_compiler: g++?
matrix:
config:
# these all fail, probably a mismatch of c++ standard?:
#- {
# name: "Binary ROOT 6.20.08, Ubuntu 20.04", artifact: "UbuntuROOT6.20.08.tar.xz",
# os: ubuntu-20.04, root: "6.20.08", root_binary: "https://root.cern/download/root_v6.20.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz",
# build_type: "Release", cc: "gcc", cxx: "g++"
# }
#- {
# name: "Binary ROOT 6.22.08, Ubuntu 20.04", artifact: "UbuntuROOT6.22.08.tar.xz",
# os: ubuntu-20.04, root: "6.22.08", root_binary: "https://root.cern/download/root_v6.22.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz",
# build_type: "Release", cc: "gcc", cxx: "g++"
# }
#- {
# name: "Binary ROOT 6.24.08, Ubuntu 20.04", artifact: "UbuntuROOT6.24.08.tar.xz",
# os: ubuntu-20.04, root: "6.24.08", root_binary: "https://root.cern/download/root_v6.24.08.Linux-ubuntu20-x86_64-gcc9.4.tar.gz",
# build_type: "Release", cc: "gcc", cxx: "g++"
# }
# this one fails because mathmore is missing:
#- {
# name: "Binary ROOT 6.26.16, Ubuntu 22.04", artifact: "UbuntuROOT6.26.16.tar.xz",
# os: ubuntu-22.04, root: "6.26.16", root_binary: "https://root.cern/download/root_v6.26.16.Linux-ubuntu22-x86_64-gcc11.4.debug.tar.gz",
# build_type: "Release", cc: "gcc", cxx: "g++"
# }
- {
name: "Binary ROOT 6.28.12, Ubuntu 22.04", artifact: "UbuntuROOT6.28.12.tar.xz",
os: ubuntu-22.04, root: "6.28.12", root_binary: "https://root.cern/download/root_v6.28.12.Linux-ubuntu22-x86_64-gcc11.4.tar.gz",
build_type: "Release", cc: "gcc", cxx: "g++"
}
- {
name: "Binary ROOT 6.30.06, Ubuntu 22.04", artifact: "UbuntuROOT6.30.06.tar.xz",
os: ubuntu-22.04, root: "6.30.06", root_binary: "https://root.cern/download/root_v6.30.06.Linux-ubuntu22.04-x86_64-gcc11.4.tar.gz",
build_type: "Release", cc: "gcc", cxx: "g++"
}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{github.workspace}}/build" >> "$GITHUB_OUTPUT"
- name: Install packages
run: |
sudo apt-get install binutils cmake dpkg-dev g++ gcc libssl-dev git libx11-dev libxext-dev libxft-dev libxpm-dev python3 gfortran libpcre3-dev xlibmesa-glu-dev libglew-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python3-dev python3-numpy libxml2-dev libkrb5-dev libgsl0-dev nlohmann-json3-dev libtbb-dev
- name: Download ROOT
run: |
wget ${{matrix.config.root_binary}}
tar -xzf root_v6.*.tar.gz
ls
shell: bash
- name: Configure ROOT
#if: ${{hashFiles('root_v${{matrix.config.root}}/bin/thisroot.sh') != ''}}
run: |
source root/bin/thisroot.sh
echo "using $(which root)"
shell: bash
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{steps.strings.outputs.build-output-dir}}
-DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
-DCMAKE_C_COMPILER=${{matrix.config.cc}}
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}}
-DCMAKE_PREFIX_PATH=root
-S ${{github.workspace}}
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{steps.strings.outputs.build-output-dir}} --config ${{matrix.config.build_type}} -j4
- name: Test
working-directory: ${{steps.strings.outputs.build-output-dir}}
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{matrix.config.build_type}}