Skip to content

Commit

Permalink
Update codecov.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronBrennan1 authored Nov 5, 2024
1 parent 525a71d commit 65fad09
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ jobs:
uses: matlab-actions/setup-matlab@v1
with:
release: R2022a # Specify the MATLAB version


# Run only the specific test_myfunction.m file from the /tests directory.
- name: Run MATLAB tests and generate coverage
# Run MATLAB tests with MOcov to generate coverage
- name: Run MATLAB tests and generate MOcov coverage
run: |
matlab -batch "import matlab.unittest.TestRunner; import matlab.unittest.plugins.CodeCoveragePlugin; import matlab.unittest.plugins.codecoverage.CoberturaFormat; runner = TestRunner.withTextOutput; runner.addPlugin(CodeCoveragePlugin.forFolder('src', 'Producing', CoberturaFormat('coverage.xml'))); results = runner.run(testsuite('test/test_myfunction.m')); assertSuccess(results);"
matlab -batch "
addpath('/opt/MOcov/MOcov'); % Add MOcov to MATLAB path
test_suite = testsuite('test/test_myfunction.m');
cov_data = mocov('-cover', 'src', '-tests', test_suite, '-quiet', '-cover_xml_file', 'coverage.xml');
"
# Upload coverage report to Codecov
- name: Upload coverage to Codecov
run: |
Expand Down

0 comments on commit 65fad09

Please sign in to comment.