Skip to content

Commit

Permalink
[ghactions] Update runner images and compiler version
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoemi09 committed Sep 30, 2024
1 parent 0a54d05 commit 393cc4e
Showing 1 changed file with 33 additions and 29 deletions.
62 changes: 33 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, doc: OFF, cov: ON}
- {os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, doc: ON, cov: OFF}
- {os: macos-12, cc: gcc-12, cxx: g++-12, doc: OFF, cov: OFF}
- {os: macos-12, cc: clang, cxx: clang++, doc: OFF, cov: OFF}
- {os: ubuntu-24.04, cc: gcc, cxx: g++, doc: OFF, cov: ON}
- {os: ubuntu-24.04, cc: clang, cxx: clang++, doc: ON, cov: OFF}
- {os: macos-14, cc: gcc-14, cxx: g++-14, doc: OFF, cov: OFF}
- {os: macos-14, cc: clang, cxx: clang++, doc: OFF, cov: OFF}

runs-on: ${{ matrix.os }}

Expand All @@ -44,22 +44,21 @@ jobs:
ccache-${{ matrix.os }}-${{ matrix.cc }}-

- name: Install ubuntu dependencies
if: matrix.os == 'ubuntu-22.04'
if: ${{ contains(matrix.os, 'ubuntu') }}
run: >
sudo apt-get update &&
sudo apt-get install lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install
ccache
clang-15
g++-12
clang
g++
gfortran
hdf5-tools
libblas-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libomp-15-dev
libclang-dev
libc++-dev
libc++abi-dev
libomp-dev
libfftw3-dev
libgfortran5
libgmp-dev
Expand All @@ -69,7 +68,7 @@ jobs:
openmpi-bin
openmpi-common
openmpi-doc
python3-clang-15
python3-clang
python3-dev
python3-mako
python3-mpi4py
Expand All @@ -79,12 +78,7 @@ jobs:
python3-sphinx
python3-nbsphinx
- name: set up compilers
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
- name: set up virtualenv
- name: Set up virtualenv
run: |
mkdir $HOME/.venv
python3 -m venv --system-site-packages $HOME/.venv/my_python
Expand All @@ -93,33 +87,41 @@ jobs:
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install homebrew dependencies
if: matrix.os == 'macos-12'
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install ccache gcc@12 llvm hdf5 open-mpi openblas
brew update
brew install ccache gcc llvm hdf5 open-mpi openblas
pip install mako numpy scipy mpi4py
pip install -r requirements.txt
echo "PATH=$(brew --prefix llvm)/bin:$(brew --prefix gcc)/bin:$PATH" >> $GITHUB_ENV
- name: Build doxygen
if: matrix.doc == 'ON'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cd $HOME
git clone https://github.com/doxygen/doxygen.git
cd doxygen
git checkout 0a7e79813
git checkout Release_1_12_0
mkdir build
cd build
cmake .. -Duse_libclang=ON -Dstatic_libclang=ON -Duse_libc++=OFF -DLLVM_ROOT=/usr/lib/llvm-15/lib/cmake/llvm -DClang_ROOT=/usr/lib/llvm-15/lib/cmake/clang
cmake .. -Duse_libclang=ON -Duse_libc++=OFF
make -j 2 VERBOSE=1
cp bin/doxygen /usr/local/bin/doxygen
- name: set clang environment
- name: Add clang CXXFLAGS
if: ${{ contains(matrix.cxx, 'clang') }}
run: |
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "PATH=/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/local/opt/llvm/lib" >> $GITHUB_ENV
- name: set up test coverage
- name: Add clang LDFLAGS for macos to link against brew's libc++
if: ${{ contains(matrix.os, 'macos') && contains(matrix.cxx, 'clang') }}
run: |
echo 'LDFLAGS="-L$(brew --prefix llvm)/lib/c++ -L$(brew --prefix llvm)/lib -lunwind"' >> $GITHUB_ENV
- name: Set up test coverage
if: matrix.cov == 'ON'
run: |
pip install gcovr
Expand All @@ -135,13 +137,15 @@ jobs:
mv tmp_basic_array_view.hpp basic_array_view.hpp
- name: Build nda
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DPythonSupport=ON -DBuild_Documentation=${{ matrix.doc }} -DCMAKE_BUILD_TYPE=${{ matrix.cov == 'ON' && 'Debug' || 'Release' }}
make -j2 || make -j1 VERBOSE=1
- name: Test nda
env:
DYLD_FALLBACK_LIBRARY_PATH: /usr/local/opt/llvm/lib
OPENBLAS_NUM_THREADS: "1"
run: |
cd build
Expand All @@ -152,7 +156,7 @@ jobs:
run: |
cd build
mkdir coverage
gcovr --gcov-executable "gcov-12" --root ../c++ --html-details -o coverage/coverage.html .
gcovr --gcov-executable "gcov" --root ../c++ --html-details -o coverage/coverage.html .
- name: ccache statistics
if: always()
Expand Down

0 comments on commit 393cc4e

Please sign in to comment.