Skip to content

Build and Test

Build and Test #65

# build-and-test.yml
#
# - Builds PyMFEM in three stages:
# - MFEM dependencies + MFEM
# - SWIG bindings
# - PyMFEM
# - Runs tests under `run_examples.py`
# - If there is a failure, uploads test outputs as an artifact
name: Build and Test
on:
workflow_dispatch:
inputs:
test_matrix:
description: 'Test all options in the matrix. If set to false, will only trigger the CI for the default options.'
required: true
default: false
type: boolean
pull_request:
jobs:
build-and-test-matrix:
if: ${{ github.event_name == 'pull_request' || inputs.test_matrix == true }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] # 3.12 is not supported by scipy
# NOTE: If setup.py could accept a commit hash as an argument, that could give us more flexibility here
mfem-branch: [master, default] # 'default' uses a specific commit hash defined in setup.py:repos_sha
parallel: [false, true]
cuda: [true]
libceed: [false]
gslib: [true]
phases: [true]
exclude:
# CUDA does not support MacOS
- os: macos-latest
cuda: true
runs-on: ${{ matrix.os }}
name: >-
Build/test:
${{ matrix.os }},
${{ matrix.python-version }},
${{ matrix.mfem-branch }},
(${{ matrix.parallel && 'parallel' || 'serial' }}${{ matrix.cuda && ' + cuda' || '' }}${{ matrix.libceed && ' + libceed' || '' }}${{ matrix.gslib && ' + gslib' || '' }})
env:
cuda-toolkit-version: '12.4.1'
cuda-driver-version: '550.54.15'
# -------------------------------------------------------------------------------------------------
# Begin workflow
# -------------------------------------------------------------------------------------------------
steps:
- name: Build and test pymfem
uses: mfem/github-actions/build-pymfem@pymfem-workflow
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
mfem-branch: ${{ matrix.mfem-branch }}
parallel: ${{ matrix.parallel }}
cuda: ${{ matrix.cuda }}
cuda-toolkit-version: ${{ env.cuda-toolkit-version }}
cuda-driver-version: ${{ env.cuda-driver-version }}
libceed: ${{ matrix.libceed }}
gslib: ${{ matrix.gslib }}
phases: ${{ matrix.phases }}
build-and-test-defaults:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' && inputs.test_matrix == false }}
name: "Build/test: (defaults)"
steps:
- name: Build and test pymfem
uses: mfem/github-actions/build-pymfem@pymfem-workflow