Make CMAKE_CXX_STANDARD a CACHE variable #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths-ignore: | |
- .gitignore | |
- .gitlab-ci.yml | |
- '**.md' | |
- 'docs/**' | |
- 'docker/**' | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
CMAKE_VERBOSE_MAKEFILE: true | |
CTEST_OUTPUT_ON_FAILURE: true | |
jobs: | |
alpine: | |
name: Alpine | |
runs-on: ubuntu-latest | |
container: alpine | |
env: | |
CMAKE_ARGS: -DCMAKE_INSTALL_PREFIX=/usr | |
steps: | |
- name: Install dependencies | |
shell: sh | |
run: | | |
apk add \ | |
bash \ | |
cmake \ | |
cppunit-dev \ | |
curl-dev \ | |
fuse-dev \ | |
fuse3-dev \ | |
g++ \ | |
git \ | |
gtest-dev \ | |
json-c-dev \ | |
krb5-dev \ | |
libxml2-dev \ | |
linux-headers \ | |
make \ | |
openssl-dev \ | |
py3-pip \ | |
py3-setuptools \ | |
py3-wheel \ | |
python3-dev \ | |
readline-dev \ | |
tinyxml-dev \ | |
util-linux-dev \ | |
zlib-dev | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: CTest Build | |
run: ctest -VV -S test.cmake | |
- name: Install with CMake | |
run: cmake --install build | |
- name: Run post-install tests | |
run: tests/post-install.sh | |
fedora: | |
name: Fedora | |
runs-on: ubuntu-latest | |
container: fedora | |
env: | |
CMAKE_GENERATOR: Ninja | |
CMAKE_ARGS: -DCMAKE_INSTALL_RPATH='$ORIGIN/../$LIB' | |
steps: | |
- name: Install dependencies | |
run: dnf install -y dnf-plugins-core git ninja-build rpmdevtools | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install XRootD build dependencies | |
run: dnf builddep -y xrootd.spec | |
- name: Build and Test with CTest | |
run: ctest -VV -S test.cmake | |
- name: Install with CMake | |
run: cmake --install build | |
- name: Run post-install tests | |
run: tests/post-install.sh | |
ubuntu: | |
name: Ubuntu | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
compiler: [ gcc, clang ] | |
env: | |
CC: ${{ matrix.compiler }} | |
DEBIAN_FRONTEND: noninteractive | |
CMAKE_ARGS: '-DINSTALL_PYTHON_BINDINGS=0;-DUSE_SYSTEM_ISAL=1;-DCMAKE_INSTALL_PREFIX=/usr' | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt update -q | |
sudo apt install -y \ | |
cmake \ | |
clang \ | |
davix-dev \ | |
g++ \ | |
libcppunit-dev \ | |
libcurl4-openssl-dev \ | |
libfuse-dev \ | |
libgtest-dev \ | |
libisal-dev \ | |
libjson-c-dev \ | |
libkrb5-dev \ | |
libmacaroons-dev \ | |
libreadline-dev \ | |
libscitokens-dev \ | |
libssl-dev \ | |
libsystemd-dev \ | |
libtinyxml-dev \ | |
libxml2-dev \ | |
make \ | |
pkg-config \ | |
python3-dev \ | |
python3-pip \ | |
python3-setuptools \ | |
python3-wheel \ | |
uuid-dev \ | |
voms-dev \ | |
zlib1g-dev | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build and Test with CTest | |
run: env CC=${CC} CXX=${CC/g*/g++} ctest -VV -S test.cmake | |
- name: Install with CMake | |
run: sudo cmake --install build | |
- name: Install Python bindings | |
run: | | |
sudo python3 -m pip install \ | |
--target /usr/lib/python3/dist-packages \ | |
--use-pep517 --verbose build/bindings/python | |
- name: Run post-install tests | |
run: tests/post-install.sh | |
macos: | |
strategy: | |
matrix: | |
version: [ 12, 13 ] | |
name: macOS | |
runs-on: macos-${{ matrix.version }} | |
env: | |
CC: clang | |
CXX: clang++ | |
CMAKE_ARGS: "-DPython_FIND_UNVERSIONED_NAMES=FIRST;-DUSE_SYSTEM_ISAL=TRUE" | |
CMAKE_PREFIX_PATH: /usr/local/opt/openssl@3 | |
steps: | |
- name: Workaround for issue 1772 | |
run: sudo sed -i -e "s/localhost/localhost $(hostname)/g" /etc/hosts | |
- name: Install dependencies with Homebrew | |
run: brew install cmake cppunit davix googletest isa-l openssl@3 python3 | |
- name: Install Python dependencies with pip | |
run: python3 -m pip install --upgrade pip setuptools wheel | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build and Test with CTest | |
run: ctest -VV -S test.cmake | |
- name: Install with CMake | |
run: cmake --install build | |
- name: Run post-install tests | |
run: | | |
export PYVERSION=$(python3 --version | grep -o 3...) | |
export PYTHONPATH=/usr/local/lib/python${PYVERSION}/site-packages | |
tests/post-install.sh |