Skip to content

[MAINT] use same testing strategy as for moxunit #15

[MAINT] use same testing strategy as for moxunit

[MAINT] use same testing strategy as for moxunit #15

Workflow file for this run

---
name: CI matlab
on:
push:
branches: [master]
pull_request:
branches: ['*']
jobs:
matlab_tests:
strategy:
matrix:
# Note that some older versions (e.g R2020a, R2020b...) may not be available on all OS
matlab_version: [R2022a, R2022b, R2023a, R2023b]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false # Don't cancel all jobs if one fails
runs-on: ${{ matrix.os }}
steps:
# use matlab-actions/setup-matlab to setup a specific version of MATLAB
# https://github.com/matlab-actions/setup-matlab
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.matlab_version }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Moxunit
run: git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
# use matlab-actions/setup-matlab to run a matlab command
# https://github.com/matlab-actions/setup-matlab
- name: Run tests on dummy source code to test MoCov
uses: matlab-actions/run-command@v2
with:
command: cd('./MOxUnit/MOxUnit/'); moxunit_set_path(); cd ../..; addpath(fullfile(pwd, 'MOcov')); moxunit_runtests tests -verbose -recursive
-with_coverage -cover tests/regression/src -cover_xml_file coverage.xml; exit(double(~ans))
- name: Code coverage
uses: codecov/codecov-action@v5
with:
files: coverage.xml
flags: ${{ matrix.os }}_matlab-${{ matrix.matlab_version }}
name: codecov-matlab
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}