Skip to content

Fix (hopefully) MATLAB run command in CI #32

Fix (hopefully) MATLAB run command in CI

Fix (hopefully) MATLAB run command in CI #32

Workflow file for this run

name: Tests
on:
push:
branches: [main]
paths: [ 'src/**', 'tests/tests_all.m', '.github/workflows/tests.yml' ]
pull_request:
branches: [main]
paths: [ 'src/**', 'tests/tests_all.m', '.github/workflows/tests.yml' ]
jobs:
tests:
runs-on: ${{ matrix.config.os }}
name: Test on ${{ matrix.config.os }} / (${{ matrix.config.moc }})
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, moc: 'octave'}
- {os: ubuntu-latest, moc: 'matlab'}
steps:
- name: Install Octave
if: matrix.config.moc == 'octave'
run: |
sudo apt update
sudo apt install -y octave octave-statistics
- name: Install MATLAB
if: matrix.config.moc == 'matlab'
uses: matlab-actions/setup-matlab@v2
- name: Clone MOCluGen
uses: actions/checkout@v4
- name: Install MOxUnit
uses: actions/checkout@v4
with:
repository: 'MOxUnit/MOxUnit'
path: 'MOxUnit'
- name: Run tests on Octave
if: matrix.config.moc == 'octave'
env:
MOXUNIT_PATH: ${{ github.workspace }}/MOxUnit/MOxUnit
run: octave --no-gui tests/run_headless.m
- name: Run tests on MATLAB
if: matrix.config.moc == 'matlab'
env:
MOXUNIT_PATH: ${{ github.workspace }}/MOxUnit/MOxUnit
uses: matlab-actions/run-command@v2
with:
command: addpath('tests'), run_headless