Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows MATLAB-Actions Runners #81

Merged
merged 3 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest] # windows-latest
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
runs-on: ${{ matrix.os }}
env:
Expand All @@ -31,21 +31,24 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install mhkit module (from source)
run: python -m pip install -e . "matplotlib<3.4.2"
run: python -m pip install -e .
working-directory: ${{env.mhkit-python-dir}}
- name: Install mhkit-python-utils module
run: python -m pip install -e .
- name: Create MATLAB batch command
- name: Set MATLAB OutOfProcess Python execution mode
shell: bash
run: echo "pyenv('ExecutionMode', 'OutOfProcess')" > run.m
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' }}
- name: Add MATLAB test commands
shell: bash
run: echo "COMMAND=pyenv('ExecutionMode', 'OutOfProcess'),
version,
addpath(genpath('mhkit')),
import matlab.unittest.TestSuite,
import matlab.unittest.TestRunner,
testFolder = ['mhkit' filesep 'tests'],
suite = TestSuite.fromFolder(testFolder),
runner = TestRunner.withTextOutput,
results = runner.run(suite),
assertSuccess(results)" >> "$GITHUB_ENV"
run: echo "version,
addpath(genpath('mhkit')),
import matlab.unittest.TestSuite,
import matlab.unittest.TestRunner,
testFolder = ['mhkit' filesep 'tests'],
suite = TestSuite.fromFolder(testFolder),
runner = TestRunner.withTextOutput,
results = runner.run(suite),
assertSuccess(results)" >> run.m
- name: Install and test MHKiT-MATLAB
run: matlab -batch "${{ env.COMMAND }}"
run: matlab -batch "run"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ Thumbs.db
*build
*.prj
.gitignore

# Test results
mhkit/tests/test_results/*
2 changes: 1 addition & 1 deletion mhkit/tests/runTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
runner.addPlugin(plugin);

% Add PDF
pdfFile = fullfile(testsFolder, 'test_results.pdf');
pdfFile = fullfile(htmlFolder, 'test_results.pdf');
plugin = TestReportPlugin.producingPDF(pdfFile);
runner.addPlugin(plugin);

Expand Down