create callable workflow #71
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
# build-and-test.yml | |
# | |
# Dispatch workflow for build-and-test-callable.yml | |
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.' | |
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: ./.github/workflows/build-and-test-callable.yml@callable_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: ./.github/workflows/build-and-test-callable.yml@callable_workflow |