Skip to content

change code to use mfem/github-actions #67

change code to use mfem/github-actions

change code to use mfem/github-actions #67

# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-806117.
#
# This file is part of the MFEM library. For more information and source code
# availability visit https://mfem.org.
#
# MFEM is free software; you can redistribute it and/or modify it under the
# terms of the BSD-3 license. We welcome feedback and contributions, see file
# CONTRIBUTING.md for details.# 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/test PyMFEM
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
# -------------------------------------------------------------------------------------------------
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'
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
# -------------------------------------------------------------------------------------------------
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