Skip to content

Commit

Permalink
Merge pull request #1780 from McStasMcXtrace/patch-workflows
Browse files Browse the repository at this point in the history
Patch "basictest" workflows for use of macOS 14/15
  • Loading branch information
willend authored Nov 27, 2024
2 parents 196b8fd + ff412a6 commit 00b989e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 30 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ jobs:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.10' }
- { os: ubuntu-22.04, CC: clang, CXX: clang++, python: '3.11' }
- { os: ubuntu-22.04, CC: gcc-12, CXX: g++-12, python: '3.11' }
- { os: macos-13, CC: clang, CXX: clang++, python: "3.11" }
# - { os: macos-14, CC: clang, CXX: clang++, python: "3.11" }
# - { os: macos-15, CC: clang, CXX: clang++, python: "3.11" }
- { os: windows-latest, CC: gcc, CXX: g++, python: "3.11" }
- { os: ubuntu-24.04, CC: gcc-13, CXX: g++-13, python: '3.12' }
- { os: ubuntu-24.04, CC: clang, CXX: clang++, python: '3.12' }
- { os: ubuntu-22.04, CC: clang, CXX: clang++, python: '3.11' }
- { os: ubuntu-22.04, CC: gcc-12, CXX: g++-12, python: '3.11' }
- { os: macos-14, CC: clang, CXX: clang++, python: "3.12" }
- { os: macos-15, CC: clang, CXX: clang++, python: "3.13" }
- { os: windows-latest, CC: gcc, CXX: g++, python: "3.12" }

name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -67,9 +65,9 @@ jobs:
run: |
sudo apt -y install libopenmpi-dev
- name: Setup OpenMPI (macOS-12,13)
- name: Setup OpenMPI (macOS)
id: setup-openmpi-macos12
if: runner.os == 'macOS' && matrix.os != 'macos-11'
if: runner.os == 'macOS'
run: |
brew install openmpi
Expand All @@ -93,7 +91,7 @@ jobs:
mkdir build_mcstas
cd build_mcstas
export EXTRA_ARGS_FOR_CMAKE=""
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison -DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "Linux" ]; then export EXTRA_ARGS_FOR_CMAKE="-DNEXUSLIB=/usr/lib -DNEXUSINCLUDE=/usr/include/nexus"; fi
cmake \
-DCMAKE_INSTALL_PREFIX=../install_mcstas \
Expand Down Expand Up @@ -138,10 +136,17 @@ jobs:
set -e
set -u
set -x
python3 -mpip install PyYAML ply McStasscript
if [ "$RUNNER_OS" != "Windows" ];
if [ "$RUNNER_OS" == "Windows" ];
then
python3 -mpip install PyYAML ply McStasscript
fi
if [ "$RUNNER_OS" == "macOS" ];
then
python3 -mpip install PyYAML ply McStasScript ncrystal --break-system-packages
fi
if [ "$RUNNER_OS" == "Linux" ];
then
python3 -mpip install ncrystal
python3 -mpip install PyYAML ply McStasscript ncrystal
fi
- name: Launch BNL_H8 instrument
Expand Down Expand Up @@ -169,7 +174,7 @@ jobs:
- name: Launch BNL_H8 instrument (MPI)
id: h8-test-mpi
if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.os != 'macos-11') # Linux or macos-12/13 only
if: runner.os == 'Linux' || (runner.os == 'macOS' )
run: |
set -e
set -u
Expand Down Expand Up @@ -202,7 +207,7 @@ jobs:
- name: Launch MCPL test instrument (mpi)
id: mcpl-test-mpi
if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.os != 'macos-11') # Linux or macos-12/13 only
if: runner.os == 'Linux' || runner.os == 'macOS' # Linux or macos only
# Status: Works on Unixes ("wrapper batches missing for Windows")
run: |
set -e
Expand Down Expand Up @@ -236,7 +241,7 @@ jobs:
- name: Launch NCrystal test instrument (mpi)
id: ncrystal-test-mpi
if: runner.os == 'Linux'
if: runner.os == 'Linux' || runner.os == 'macOS' # Linux or macOS only
# Status: Works on Unixes ("ncrystal missing for Windows")
run: |
set -e
Expand All @@ -253,7 +258,7 @@ jobs:
mpirun --version
ncrystal-config --version
if [ "x$(uname)" == "xLinux" ]; then
export NUM_MPI=2
export NUM_MPI=2
else
export NUM_MPI=1
fi
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/mcxtrace-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ jobs:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' }
- { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.10' }
- { os: ubuntu-24.04, CC: gcc-13, CXX: g++-13, python: '3.12' }
- { os: ubuntu-24.04, CC: clang, CXX: clang++, python: '3.12' }
- { os: ubuntu-22.04, CC: clang, CXX: clang++, python: '3.11' }
- { os: ubuntu-22.04, CC: gcc-12, CXX: g++-12, python: '3.11' }
- { os: macos-13, CC: clang, CXX: clang++, python: "3.11" }
# - { os: macos-14, CC: clang, CXX: clang++, python: "3.11" }
# - { os: macos-15, CC: clang, CXX: clang++, python: "3.11" }
- { os: windows-latest, CC: gcc, CXX: g++, python: "3.11" }
- { os: macos-14, CC: clang, CXX: clang++, python: "3.12" }
- { os: macos-15, CC: clang, CXX: clang++, python: "3.13" }
- { os: windows-latest, CC: gcc, CXX: g++, python: "3.12" }

name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -67,9 +65,9 @@ jobs:
run: |
sudo apt -y install libopenmpi-dev
- name: Setup OpenMPI (macOS-12,13)
- name: Setup OpenMPI (macOS)
id: setup-openmpi-macos12
if: runner.os == 'macOS' && matrix.os != 'macos-11'
if: runner.os == 'macOS'
run: |
brew install openmpi
Expand All @@ -93,7 +91,9 @@ jobs:
mkdir build_mcxtrace
cd build_mcxtrace
export EXTRA_ARGS_FOR_CMAKE=""
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison -DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison -DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "macOS" ]; then export EXTRA_ARGS_FOR_CMAKE="-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison -DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex"; fi
if [ "$RUNNER_OS" == "Linux" ]; then export EXTRA_ARGS_FOR_CMAKE="-DNEXUSLIB=/usr/lib -DNEXUSINCLUDE=/usr/include/nexus"; fi
cmake \
-DCMAKE_INSTALL_PREFIX=../install_mcxtrace \
Expand Down Expand Up @@ -137,7 +137,15 @@ jobs:
set -e
set -u
set -x
python3 -mpip install PyYAML ply McStasscript
if [ "$RUNNER_OS" != "macOS" ];
then
python3 -mpip install PyYAML ply McStasscript
fi
if [ "$RUNNER_OS" == "macOS" ];
then
python3 -mpip install PyYAML ply McStasScript --break-system-packages
fi
- name: Launch JJ_SAXS instrument
id: JJ_SAXS-basic
Expand Down

0 comments on commit 00b989e

Please sign in to comment.