Skip to content

Fix setting compiler for MacOS runners. #120

Fix setting compiler for MacOS runners.

Fix setting compiler for MacOS runners. #120

name: 'Build and Test QUICK Serial Version'
defaults:
run:
shell: bash
on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
build-and-test-serial-legacy-configure-make:
strategy:
fail-fast: false
matrix:
include:
- os: 'ubuntu-22.04'
compiler-type: 'gnu'
compiler-version: '10'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-10 g++-10 gfortran-10'
- os: 'ubuntu-22.04'
compiler-type: 'gnu'
compiler-version: '11'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-11 g++-11 gfortran-11'
- os: 'ubuntu-24.04'
compiler-type: 'gnu'
compiler-version: '12'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-12 g++-12 gfortran-12'
- os: 'ubuntu-24.04'
compiler-type: 'gnu'
compiler-version: '13'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-13 g++-13 gfortran-13'
- os: 'ubuntu-24.04'
compiler-type: 'gnu'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-14 g++-14 gfortran-14'
- os: 'ubuntu-24.04-arm'
compiler-type: 'gnu'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-14 g++-14 gfortran-14'
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - Serial - Legacy - ${{ matrix.compiler-type }} - ${{ matrix.compiler-version }}
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Linux: Install Dependencies for Serial Version'
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install ${{ matrix.compiler-install }} parallel
if [[ ${{ matrix.compiler-type }} == 'gnu' || ${{ matrix.compiler-type }} == 'clang' ]]; then
sudo rm /usr/bin/${{ matrix.c-compiler }}
sudo ln -s -T ${{ matrix.c-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.c-compiler }}
sudo rm /usr/bin/${{ matrix.cxx-compiler }}
sudo ln -s -T ${{ matrix.cxx-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.cxx-compiler }}
if [[ ${{ matrix.compiler-type }} == 'gnu' ]]; then
sudo rm /usr/bin/${{ matrix.fortran-compiler }}
sudo ln -s -T ${{ matrix.fortran-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.fortran-compiler }}
fi
fi
- name: 'Linux: Log Softare Environment Configuration'
if: runner.os == 'Linux'
run: |
echo "OS version:"
cat /etc/os-release
echo
echo "Kernel version:"
uname -a
echo
ldd --version
echo
echo "Fortran compiler version:"
${{ matrix.fortran-compiler }} --version
echo
echo "GNU Parallel version:"
parallel --version
- name: 'Setup Environment Variables for Building and Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
echo "PARALLEL_TEST_COUNT=2" >> "$GITHUB_ENV"
echo "CC=${{ matrix.c-compiler }}" >> "$GITHUB_ENV"
echo "CXX=${{ matrix.cxx-compiler }}" >> "$GITHUB_ENV"
echo "FC=${{ matrix.fortran-compiler }}" >> "$GITHUB_ENV"
- name: 'Configure Serial Version'
run: |
./configure --serial --enablef --prefix $PWD/install \
${{ matrix.compiler-type }}
- name: 'Build and Install Serial Version Using 2 Jobs'
run: |
make -j2 all install
- name: 'Run Tests for Serial Version (Make)'
run: |
make fulltest
- name: 'Upload Test Artifacts for Serial Version'
if: always()
uses: actions/upload-artifact@v4
with:
name: serial-legacy-configure-make-tests-${{ matrix.os }}-${{ matrix.compiler-type }}-${{ matrix.compiler-version }}
path: ${{ github.workspace }}/install/test/runs/serial
retention-days: 3
compression-level: 6
- name: 'Download Test Artifacts for Serial Version'
uses: actions/download-artifact@v4
with:
name: serial-legacy-configure-make-tests-${{ matrix.os }}-${{ matrix.compiler-type }}-${{ matrix.compiler-version }}
- name: 'Display Artifacts'
run: |
ls -R
build-and-test-serial-cmake:
strategy:
fail-fast: false
matrix:
include:
- os: 'ubuntu-22.04'
compiler-type: 'GNU'
compiler-version: '10'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-10 g++-10 gfortran-10'
- os: 'ubuntu-22.04'
compiler-type: 'GNU'
compiler-version: '11'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-11 g++-11 gfortran-11'
- os: 'ubuntu-24.04'
compiler-type: 'GNU'
compiler-version: '12'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-12 g++-12 gfortran-12'
- os: 'ubuntu-24.04'
compiler-type: 'GNU'
compiler-version: '13'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-13 g++-13 gfortran-13'
- os: 'ubuntu-24.04'
compiler-type: 'GNU'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-14 g++-14 gfortran-14'
- os: 'ubuntu-24.04'
compiler-type: 'CLANG'
compiler-version: '17'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fortran-compiler: 'gfortran'
compiler-install: 'clang-17 gfortran'
- os: 'ubuntu-24.04'
compiler-type: 'CLANG'
compiler-version: '18'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fortran-compiler: 'gfortran'
compiler-install: 'clang-18 gfortran'
- os: 'ubuntu-24.04-arm'
compiler-type: 'GNU'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc-14 g++-14 gfortran-14'
- os: 'ubuntu-24.04-arm'
compiler-type: 'CLANG'
compiler-version: '18'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fortran-compiler: 'gfortran'
compiler-install: 'clang-18 gfortran'
- os: 'macos-13'
compiler-type: 'GNU'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc@14'
- os: 'macos-13'
compiler-type: 'CLANG'
compiler-version: '15'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fortran-compiler: 'gfortran-14'
compiler-install: 'llvm@15 gcc@14'
- os: 'macos-14'
compiler-type: 'GNU'
compiler-version: '14'
c-compiler: 'gcc'
cxx-compiler: 'g++'
fortran-compiler: 'gfortran'
compiler-install: 'gcc@14'
- os: 'macos-14'
compiler-type: 'CLANG'
compiler-version: '15'
c-compiler: 'clang'
cxx-compiler: 'clang++'
fortran-compiler: 'gfortran-14'
compiler-install: 'llvm@15 gcc@14'
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - Serial - CMake - ${{ matrix.compiler-type }} - ${{ matrix.compiler-version }}
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Linux: Install Dependencies for Serial Version'
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install ${{ matrix.compiler-install }} \
cmake parallel
if [[ ${{ matrix.compiler-type }} == 'GNU' || ${{ matrix.compiler-type }} == 'CLANG' ]]; then
sudo rm /usr/bin/${{ matrix.c-compiler }}
sudo ln -s -T ${{ matrix.c-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.c-compiler }}
sudo rm /usr/bin/${{ matrix.cxx-compiler }}
sudo ln -s -T ${{ matrix.cxx-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.cxx-compiler }}
if [[ ${{ matrix.compiler-type }} == 'GNU' ]]; then
sudo rm /usr/bin/${{ matrix.fortran-compiler }}
sudo ln -s -T ${{ matrix.fortran-compiler }}-${{ matrix.compiler-version }} /usr/bin/${{ matrix.fortran-compiler }}
fi
fi
- name: 'MacOS: Install Dependencies for Serial Version'
if: runner.os == 'macOS'
run: |
brew install ${{ matrix.compiler-install }} cmake parallel
if [[ ${{ matrix.compiler-type }} == 'GNU' || ${{ matrix.compiler-type }} == 'CLANG' ]]; then
sudo ln -s -T /opt/homebrew/bin/${{ matrix.c-compiler }}-${{ matrix.compiler-version }} /opt/homebrew/bin/${{ matrix.c-compiler }}
sudo ln -s -T /opt/homebrew/bin/${{ matrix.cxx-compiler }}-${{ matrix.compiler-version }} /opt/homebrew/bin/${{ matrix.cxx-compiler }}
if [[ ${{ matrix.compiler-type }} == 'GNU' ]]; then
sudo ln -s -T /opt/homebrew/bin/${{ matrix.fortran-compiler }}-${{ matrix.compiler-version }} /opt/homebrew/bin/${{ matrix.fortran-compiler }}
fi
fi
- name: 'Linux: Log Softare Environment Configuration'
if: runner.os == 'Linux'
run: |
echo "OS version:"
cat /etc/os-release
echo
echo "Kernel version:"
uname -a
echo
ldd --version
echo
echo "Fortran compiler version:"
${{ matrix.fortran-compiler }} --version
echo
echo "CMake version:"
cmake --version
echo
echo "GNU Parallel version:"
parallel --version
- name: 'MacOS: Log Softare Environment Configuration'
if: runner.os == 'macOS'
run: |
echo "OS version:"
cat /System/Library/CoreServices/SystemVersion.plist
echo
echo "Kernel version:"
uname -a
echo
echo "Fortran compiler version:"
${{ matrix.fortran-compiler }} --version
echo
echo "CMake version:"
cmake --version
echo
echo "GNU Parallel version:"
parallel --version
- name: 'Setup Environment Variables for Building and Running Tests'
run: |
echo "QUICK_HOME=$PWD/install" >> "$GITHUB_ENV"
echo "PARALLEL_TEST_COUNT=2" >> "$GITHUB_ENV"
echo "CC=${{ matrix.c-compiler }}" >> "$GITHUB_ENV"
echo "CXX=${{ matrix.cxx-compiler }}" >> "$GITHUB_ENV"
echo "FC=${{ matrix.fortran-compiler }}" >> "$GITHUB_ENV"
- name: 'Configure Serial Version'
run: |
mkdir build
cd build
cmake .. -DCOMPILER=${{ matrix.compiler-type }} \
-DENABLEF=TRUE -DCMAKE_INSTALL_PREFIX=$PWD/../install
- name: 'Build and Install Serial Version Using 2 Jobs'
run: |
cd build
cmake --build . --parallel 2
cmake --install .
- name: 'Run Tests for Serial Version'
run: |
cd install
./runtest --serial --full
- name: 'Upload Test Artifacts for Serial Version'
if: always()
uses: actions/upload-artifact@v4
with:
name: serial-cmake-tests-${{ matrix.os }}-${{ matrix.compiler-type }}-${{ matrix.compiler-version }}
path: ${{ github.workspace }}/install/test/runs/serial
retention-days: 3
compression-level: 6
- name: 'Download Test Artifacts for Serial Version'
uses: actions/download-artifact@v4
with:
name: serial-cmake-tests-${{ matrix.os }}-${{ matrix.compiler-type }}-${{ matrix.compiler-version }}
- name: 'Display Artifacts'
run: ls -R