Skip to content

Commit

Permalink
Simplify workflow; fix tests/ cmake issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Mar 1, 2024
1 parent 64dc420 commit ebab458
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 61 deletions.
64 changes: 4 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: "Test Builds"
on:
push:
branches:
- main
- '*'
pull_request:
branches:
- main
jobs:
pyexp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest]
cc: [gcc, mpicc]

name: "Test pyEXP Build"
Expand All @@ -26,19 +26,12 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
- name: Setup submodule and build
run: |
git submodule update --init --recursive
mkdir -p build/install
- name: Compile pyEXP - Linux
- name: Compile pyEXP
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
Expand All @@ -53,27 +46,6 @@ jobs:
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile pyEXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=NO
-DENABLE_PYEXP=YES
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
- name: Make
working-directory: ./build
run: make -j 2
Expand All @@ -83,7 +55,7 @@ jobs:
exp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest]
cc: [gcc, mpicc]

name: "Test Full EXP Build"
Expand All @@ -98,13 +70,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
- name: Setup submodule and build
run: |
git submodule update --init --recursive
Expand All @@ -125,27 +90,6 @@ jobs:
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile Full EXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=YES
-DENABLE_PYEXP=NO
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
- name: Make
working-directory: ./build
run: make -j 2
146 changes: 146 additions & 0 deletions .github/workflows/buildfull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: "Test Builds"

on:

jobs:
pyexp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
cc: [gcc, mpicc]

name: "Test pyEXP Build"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install core dependencies - ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
- name: Setup submodule and build
run: |
git submodule update --init --recursive
mkdir -p build/install
- name: Compile pyEXP - Linux
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=NO
-DENABLE_PYEXP=YES
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile pyEXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=NO
-DENABLE_PYEXP=YES
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
- name: Make
working-directory: ./build
run: make -j 2

# -----------------------------------------------------------------------------------

exp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
cc: [gcc, mpicc]

name: "Test Full EXP Build"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install core dependencies - ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
- name: Setup submodule and build
run: |
git submodule update --init --recursive
mkdir -p build/install
- name: Compile Full EXP - Linux
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=YES
-DENABLE_PYEXP=NO
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile Full EXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=YES
-DENABLE_PYEXP=NO
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
- name: Make
working-directory: ./build
run: make -j 2
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ if(ENABLE_NBODY)
${PYTHON_EXECUTABLE} readCoefs.py
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/Halo")
set_tests_properties(pyEXPCoefReadTest PROPERTIES DEPENDS makeNbodyTest)
set_tests_properties(pyEXPCoefReadTest PROPERTIES LABELS "long")
endif()

# A separate test to remove the generated files if they all exist;
Expand Down Expand Up @@ -136,7 +137,7 @@ if(ENABLE_NBODY)
# Set labels for pyEXP tests
set_tests_properties(expExecuteTest PROPERTIES LABELS "quick")
set_tests_properties(makeICTest expNbodyTest expNbodyCheck2TW
pyEXPCoefReadTest removeTempFiles expCubeTest removeCubeFiles
removeTempFiles expCubeTest removeCubeFiles
PROPERTIES LABELS "long")

endif()
Expand Down

0 comments on commit ebab458

Please sign in to comment.