-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (127 loc) · 4.48 KB
/
recursive.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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);