Recursive calling of MEX functions #137
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: Recursive calling of MEX functions | |
on: | |
# Trigger the workflow on push or pull request | |
push: | |
pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! | |
# Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. | |
schedule: | |
- cron: '0 12 * * *' | |
# Trigger the workflow manually | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git Ref (Optional) | |
required: false | |
depth: | |
description: Depth of recursion (Optional) | |
required: false | |
# Show the git ref in the workflow name if it is invoked manually. | |
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , recursion depth {1}', inputs.git-ref, inputs.depth) || '' }} | |
jobs: | |
test: | |
name: Recursive test of PRIMA | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-20.04, macos-11, windows-2019] | |
matlab: [R2020b, R2021a, R2022a, R2023a] | |
# Exclude some versions of OS and MATLAB. In addition to the latest versions, we intend to | |
# test the earliest version of MATLAB on each OS. | |
exclude: | |
- os: ubuntu-latest | |
matlab: R2020b | |
- os: ubuntu-latest | |
matlab: R2021a | |
- os: ubuntu-latest | |
matlab: R2022a | |
- os: ubuntu-20.04 | |
matlab: R2021a | |
- os: ubuntu-20.04 | |
matlab: R2022a | |
- os: ubuntu-20.04 | |
matlab: latest | |
- os: macos-latest | |
matlab: R2020b | |
- os: macos-latest | |
matlab: R2021a | |
- os: macos-latest | |
matlab: R2022a | |
- os: macos-11 | |
matlab: R2020b | |
- os: macos-11 | |
matlab: R2021a | |
- os: macos-11 | |
matlab: latest | |
- os: windows-latest | |
matlab: R2020b | |
- os: windows-latest | |
matlab: R2021a | |
- os: windows-latest | |
matlab: R2022a | |
- os: windows-2019 | |
matlab: R2020b | |
- os: windows-2019 | |
matlab: R2022a | |
- os: windows-2019 | |
matlab: latest | |
steps: | |
- name: Clone Repository (Latest) | |
uses: actions/[email protected] | |
if: github.event.inputs.git-ref == '' | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS | |
submodules: recursive | |
- name: Clone Repository (Custom Ref) | |
uses: actions/[email protected] | |
if: github.event.inputs.git-ref != '' | |
with: | |
ref: ${{ github.event.inputs.git-ref }} | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS | |
submodules: recursive | |
- name: Clone setup_mex | |
uses: actions/[email protected] | |
with: | |
repository: equipez/setup_mex | |
path: setup_mex | |
- name: Link gfortran for MATLAB on Linux | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
GFVER=12 | |
if [[ "${{ matrix.os }}" = "ubuntu-20.04" ]] ; then | |
GFVER=11 | |
fi | |
if [[ "${{ matrix.matlab }}" = "R2020b" || "${{ matrix.matlab }}" = "R2021a" || "${{ matrix.matlab }}" = "R2021b" ]] ; then | |
GFVER=9 | |
fi | |
bash .github/scripts/link_gfortran "$GFVER" | |
- name: Install Intel oneAPI on macOS | |
if: startsWith(matrix.os, 'macos') | |
run: bash .github/scripts/install_oneapi_macos.sh | |
- name: Install Intel oneAPI on Windows | |
if: startsWith(matrix.os, 'windows') | |
run: cmd.exe "/K" '".github\scripts\install_oneapi_windows.bat"' | |
- name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September | |
uses: actions/[email protected] | |
with: | |
path: ${{ runner.tool_cache }}/MATLAB | |
key: ${{ matrix.os }}-${{ matrix.matlab }}-yes | |
- name: Set up MATLAB | |
uses: matlab-actions/[email protected] | |
with: | |
release: ${{ matrix.matlab }} | |
- name: Conduct the test | |
uses: matlab-actions/[email protected] | |
with: | |
command: | | |
ver; | |
old_dir = cd(); | |
cd setup_mex; | |
try_mex_setup('fortran'); | |
cd(fullfile(old_dir, 'recursive')); | |
if ~isempty('${{ inputs.depth }}') | |
depth = str2num('${{ inputs.depth }}'); | |
else | |
depth = 3; | |
end | |
recursive(depth); |