-
Notifications
You must be signed in to change notification settings - Fork 11
54 lines (46 loc) · 1.34 KB
/
unit_test.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
name: Unit test
on:
# Trigger the workflow on push or pull request
push:
# Trigger the workflow manually
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
jobs:
test:
name: Unit test
runs-on: ${{matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
matlab: [R2023b, R2024a, R2024b]#, latest]
with_optim_toolbox: [no]
exclude:
- os: windows-latest
matlab: R2021a
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache MATLAB
id: cache-matlab
uses: actions/cache@v4.0.1
with:
path: ${{ runner.tool_cache }}/MATLAB
key: ${{ matrix.os }}-${{ matrix.matlab }}-${{ matrix.with_optim_toolbox }}
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2.1.2
with:
release: ${{ matrix.matlab }}
- name: Run unit test
uses: matlab-actions/run-command@v2.1.1
with:
command: |
root_dir = pwd()
% Change the directory to the folder where the unit_test.m is located
path_src = fullfile(root_dir, 'src');
cd(path_src);
% Run unit test
results = runtests(path_src)