Skip to content

Commit

Permalink
240420.105503.HKT add ubuntu to compile_mex.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Apr 20, 2024
1 parent 59f669a commit cb57af9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/compile_mex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Compile 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 0 * * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
Expand All @@ -19,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-11, macos-12, macos-13]
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04]
matlab: [R2020b, R2021a, R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]

include:
Expand Down Expand Up @@ -69,6 +75,39 @@ jobs:
- name: Miscellaneous setup
run: bash .github/scripts/misc_setup

- name: Revise fmxapi.F90
shell: bash
run: |
cd matlab/mex_gateways/
$SEDI "s|\(.*maybe due to overflow.*$\)|\1\nwrite(*,*) 'x = ', x; write(*,*) 'x_dp = ', x_dp|" fmxapi.F90
cat fmxapi.F90
- name: Revise postprima.m
shell: bash
run: |
cd matlab/interfaces/private/
$SEDI "s/max(\[0, chist\]) > 0)/max(\[0, chist\]) > 0)\nprobinfo.raw_data\noutput\nchist/" postprima.m
cat postprima.m
# - name: Revise cobylb.f
# shell: bash
# run: |
# cd fortran/classical/cobyla/
# $SEDI "s/cstrv = maxval(\[ZERO, -constr\])/cstrv = maxval([\ZERO, -constr\])\n write(*,*) 'x = ', x(1:n)\n write(*,*) 'f = ', f\n write(*,*) 'constr = ', constr(1:m)\n write(*,*) 'cstrv = ', cstrv/" cobylb.f
# cat cobylb.f

- name: Link gfortran for MATLAB on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
GFVER=${{ env.GFORTRAN_VERSION }}
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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/parallel_test_matlab_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
# Trigger the workflow manually
workflow_dispatch:

env:
MATLAB: /Applications/MATLAB_R2023b.app/bin/matlab

jobs:
test:
name: Parallel test of PRIMA
Expand Down Expand Up @@ -38,7 +41,7 @@ jobs:
submodules: recursive

- name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119
run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); parallel('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);"
run: ${{ env.MATLAB }} -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); parallel('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);"

- name: Store artifacts
uses: actions/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/recursive_test_matlab_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
# Trigger the workflow manually
workflow_dispatch:

env:
MATLAB: /Applications/MATLAB_R2023b.app/bin/matlab

jobs:
test:
name: Recursive test of PRIMA
Expand Down Expand Up @@ -38,7 +41,7 @@ jobs:
submodules: recursive

- name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119
run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); recursive('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);"
run: ${{ env.MATLAB }} -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); recursive('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);"

- name: Store artifacts
uses: actions/[email protected]
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/stress_test_matlab_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}, precision {1}', inputs.git-ref, inputs.precision) || '' }}

env:
MATLAB: /Applications/MATLAB_R2023b.app/bin/matlab

jobs:
test:
Expand Down Expand Up @@ -52,9 +54,9 @@ jobs:
- name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119
run: |
if [[ -n '${{ inputs.precision }}' ]] ; then
/Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); options.tough = strcmp('${{ matrix.test }}', 'tough'); options.precision = '${{ inputs.precision }}'; stress('${{ matrix.solver }}', options); copy_crash_dump_files(root_dir);"
${{ env.MATLAB }} -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); options.tough = strcmp('${{ matrix.test }}', 'tough'); options.precision = '${{ inputs.precision }}'; stress('${{ matrix.solver }}', options); copy_crash_dump_files(root_dir);"
else
/Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); options.tough = strcmp('${{ matrix.test }}', 'tough'); options.precision = 'date'; stress('${{ matrix.solver }}', options); copy_crash_dump_files(root_dir);"
${{ env.MATLAB }} -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); options.tough = strcmp('${{ matrix.test }}', 'tough'); options.precision = 'date'; stress('${{ matrix.solver }}', options); copy_crash_dump_files(root_dir);"
fi
- name: Store artifacts
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_matlab_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}', inputs.git-ref) || '' }}

env:
MATLAB: /Applications/MATLAB_R2023b.app/bin/matlab

jobs:
test:
Expand Down Expand Up @@ -66,7 +68,7 @@ jobs:
# cat cobylb.f

- name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119
run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "cd matlab/tests; testprima_ex();"
run: ${{ env.MATLAB }} -batch "cd matlab/tests; testprima_ex();"

# The following job check whether the tests were successful or cancelled due to timeout.
# N.B.: Remember to specify `continue-on-error: true` for the job of the tests.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ to distribute this large amount of tests to multiple Team accounts as follows.

- [Tests](https://github.com/opt4ai/prima/actions) at [opt4ai/prima](https://github.com/opt4ai/prima)

- [![Compile MEX](https://github.com/opt4ai/prima/actions/workflows/compile_mex.yml/badge.svg)](https://github.com/opt4ai/prima/actions/workflows/compile_mex.yml)
- [![Test MATLAB](https://github.com/opt4ai/prima/actions/workflows/test_matlab.yml/badge.svg)](https://github.com/opt4ai/prima/actions/workflows/test_matlab.yml)
- [![Test MATLAB, Linux](https://github.com/opt4ai/prima/actions/workflows/test_matlab_linux.yml/badge.svg)](https://github.com/opt4ai/prima/actions/workflows/test_matlab_linux.yml)

Expand Down

0 comments on commit cb57af9

Please sign in to comment.