Expand unit tests #817
Workflow file for this run
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: Spack | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test-spack: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- compiler: gcc | |
mpi: openmpi | |
runs-on: palace_ubuntu-latest_16-core | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Open MPI | |
if: matrix.mpi == 'openmpi' | |
run: | | |
sudo apt-get install -y openmpi-bin libopenmpi-dev | |
- name: Configure MPICH | |
if: matrix.mpi == 'mpich' | |
run: | | |
sudo apt-get install -y mpich libmpich-dev | |
- name: Configure Intel MPI | |
if: matrix.mpi == 'intelmpi' | |
uses: mpi4py/setup-mpi@v1 | |
with: | |
mpi: ${{ matrix.mpi }} | |
- name: Configure Clang compiler | |
if: matrix.compiler == 'clang' | |
run: | | |
sudo apt-get install -y clang lld | |
- name: Configure Intel oneAPI compiler | |
if: matrix.compiler == 'intel' | |
run: | | |
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp \ | |
intel-oneapi-compiler-fortran | |
- uses: vsoch/spack-package-action/install@main | |
- name: Build Palace | |
run: | | |
# Clean up Android SDK install (confuses Spack MKL link line?) | |
sudo rm -rf $ANDROID_HOME | |
# Set up Spack to use external packages (MPI, etc.) | |
. /opt/spack/share/spack/setup-env.sh | |
spack external find --all | |
# Build and install | |
spack repo add spack/local | |
spack dev-build local.palace@develop%${{ matrix.compiler }} ^petsc~hdf5 ^intel-oneapi-mkl | |
- name: Run tests | |
env: | |
NUM_PROC_TEST_MAX: '8' | |
run: | | |
# Configure environment | |
export NUM_PROC_TEST=$(nproc 2> /dev/null || sysctl -n hw.ncpu) | |
if [[ "$NUM_PROC_TEST" -gt "$NUM_PROC_TEST_MAX" ]]; then | |
NUM_PROC_TEST=$NUM_PROC_TEST_MAX | |
fi | |
. /opt/spack/share/spack/setup-env.sh | |
spack load palace | |
# Run tests | |
julia --project=test/examples -e 'using Pkg; Pkg.instantiate()' | |
julia --project=test/examples --color=yes test/examples/runtests.jl |