Skip to content

Introduce some new test workflow #2

Introduce some new test workflow

Introduce some new test workflow #2

Workflow file for this run

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)