Skip to content

Add a CI workflow to test MATLAB-based tutorials - #942

Merged
MakisH merged 2 commits into
developfrom
test-matlab
Oct 2, 2026
Merged

MakisH merged 2 commits into
developfrom
test-matlab

Conversation

@MakisH

@MakisH MakisH commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

In the context of #448, the only component missing is the MATLAB bindings. Potential ways to test that would be:

  • a) having a MATLAB license specifically for the tests and integrate it as usual to the system tests, potentially using the official MATLAB Docker image, which also needs a license, or
  • b) stitch something together around the setup-matlab action, which is provided for free for CI executions (as demonstrated in the matlab-bindings CI)

This PR follows the second approach:

  1. For changes to any directory that includes matlab in its name, or weekly (at the same time as the weekly system tests), or manually,
  2. Check out the tutorials repository (should work on arbitrary branches and forks)
  3. Get the latest develop of the matlab-bindings and build it in a subdirectory
  4. Check if the solverdummies run
  5. Check if the resonant-circuit runs (with exports enabled)
  6. Archive the logs, the produced plot, and the precice-exports

It does not do the numerical comparison that the system tests do. That would be nice for completeness, but I think it would be a bit too complicated as a special case, without much benefit right now. I am considering options, but this already runs and is much better than the current state. -> Added a check that the error from the analytical solution stays below some threshold. This also meant changing the run.sh to not call exit at the end.

Example test run: https://github.com/precice/tutorials/actions/runs/37068828012/job/111043137372?pr=942

Checklist

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/<PRnumber>.md.

@MakisH MakisH self-assigned this Oct 2, 2026
@MakisH
MakisH requested a review from IshaanDesai October 2, 2026 15:59

@IshaanDesai IshaanDesai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went over the workflow file, and it makes sense. I just have one minor question.

Comment thread .github/workflows/test-matlab.yml Outdated
@MakisH

MakisH commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

I added a check for the error at the end of capacitor.m, since the error from the analytical solution is already displayed as output:

% Error thresholds based on a reference run
if error_I > 0.47 || error_U > 0.12
    error("Voltage or current differs more than expected from the analytical solution.");
    quit(1)
end

I also added the logging open & close in the run.sh.

@MakisH
MakisH marked this pull request as ready for review October 2, 2026 22:29
@MakisH
MakisH merged commit 2e321d3 into develop Oct 2, 2026
2 checks passed
@MakisH
MakisH deleted the test-matlab branch October 2, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants