Skip to content

Update setup-matlab GitHub action to v2 #29

Update setup-matlab GitHub action to v2

Update setup-matlab GitHub action to v2 #29

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'
run: |
export MOXUNIT_PATH=${{ github.workspace }}/MOxUnit/MOxUnit
octave --no-gui tests/run_headless.m
- name: Run tests on MATLAB
if: matrix.config.moc == 'matlab'
run: |
export MOXUNIT_PATH=${{ github.workspace }}/MOxUnit/MOxUnit
matlab -batch "addpath('tests');run_headless"