Test running time concerning MEX #144
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: Test running time concerning MEX | |
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 20 * * 0' | |
# Trigger the workflow when it is manually triggered | |
workflow_dispatch: | |
env: | |
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18341/m_HPCKit_p_2022.1.0.86_offline.dmg | |
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler | |
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18497/w_BaseKit_p_2022.1.2.154_offline.exe | |
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18529/w_HPCKit_p_2022.1.2.116_offline.exe | |
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler | |
MATLAB_RELEASE: latest | |
GFORTRAN_VERSION: 10 | |
jobs: | |
test: | |
name: Test running time concerning MEX | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-2019] | |
language: [C, Fortran] | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
- name: prepare for cache restore for Intel oneAPI on macOS | |
if: matrix.os == 'macos-latest' && matrix.language == 'Fortran' | |
run: | | |
sudo mkdir -p /opt/intel | |
sudo chown $USER /opt/intel | |
- name: cache install Intel oneAPI on macOS | |
if: matrix.os == 'macos-latest' && matrix.language == 'Fortran' | |
id: cache-install-macos | |
uses: actions/[email protected] | |
with: | |
path: /opt/intel/oneapi | |
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }} | |
- name: install Intel oneAPI on macOS | |
if: matrix.os == 'macos-latest' && matrix.language == 'Fortran' && steps.cache-install-macos.outputs.cache-hit != 'true' | |
run: bash .github/scripts/install_oneapi_macos.sh $MACOS_HPCKIT_URL $MACOS_FORTRAN_COMPONENTS | |
- name: Run setvars.sh and make symlinks on macOS | |
if: matrix.os == 'macos-latest' && matrix.language == 'Fortran' | |
run: bash .github/scripts/intelvars_macos.sh | |
- name: cache install Intel oneAPI on Windows | |
if: startsWith(matrix.os, 'windows') && matrix.language == 'Fortran' | |
id: cache-install-windows | |
uses: actions/[email protected] | |
with: | |
path: C:\Program Files (x86)\Intel\oneAPI\compiler | |
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/.github/scripts/cache_exclude_oneapi_windows.sh') }} | |
- name: install Intel oneAPI on Windows | |
if: startsWith(matrix.os, 'windows') && matrix.language == 'Fortran' && steps.cache-install-windows.outputs.cache-hit != 'true' | |
shell: bash | |
run: .github/scripts/install_oneapi_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS | |
- name: exclude unused files from cache for Intel oneAPI on Windows | |
if: startsWith(matrix.os, 'windows') && matrix.language == 'Fortran' && steps.cache-install-windows.outputs.cache-hit != 'true' | |
shell: bash | |
run: .github/scripts/cache_exclude_oneapi_windows.sh | |
- name: Run intelvars_windows.bat | |
if: startsWith(matrix.os, 'windows') && matrix.language == 'Fortran' | |
run: | | |
cmd.exe "/K" '".github/scripts/intelvars_windows.bat" && powershell' | |
- name: Link gfortran for MATLAB on Linux | |
if: startsWith(matrix.os, 'ubuntu') && matrix.language == 'Fortran' | |
run: | | |
sudo bash .github/scripts/link_gfortran_for_matlab ${{ env.GFORTRAN_VERSION }} | |
realpath "$(command -v gfortran)" | |
- name: Set up MATLAB | |
uses: matlab-actions/[email protected] | |
with: | |
release: ${{ env.MATLAB_RELEASE }} | |
- name: Run script | |
uses: matlab-actions/[email protected] | |
with: | |
command: | | |
system('realpath "$(command -v gfortran)"'); | |
cd('mex_time'); | |
mex_time('${{ matrix.language }}'); |