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 0aca224 commit 66c7974
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,28 @@ jobs:

- name: Install MOcov
run: |
git clone https://github.com/MOcov/MOcov.git /opt/MOcov
git clone https://github.com/MOxUnit/MOcov.git /opt/MOcov
ls -la /opt/MOcov
sudo chmod -R 755 /opt/MOcov
- name: Run MATLAB tests with coverage
run: >
matlab -batch "
- name: Create and run MATLAB script
run: |
echo 'addpath(genpath('\''/opt/MOcov'\''));
addpath(genpath(''test''));
addpath(genpath(''src''));
mocov(''start'');
try
addpath(genpath('/opt/MOcov'));
addpath(genpath('test'));
addpath(genpath('src'));
mocov('start');
results = runtests('test_myfunction.m');
assert(all([results.Passed]), 'Some tests failed');
mocov('stop');
mocov('-cover', 'src', '-cover_xml_file', 'coverage.xml');
exit(0);
results = runtests(''test_myfunction.m'');
assert(all([results.Passed]), ''Some tests failed'');
mocov(''stop'');
mocov(''-cover'', ''src'', ''-cover_xml_file'', ''coverage.xml'');
exit(0);
catch e
disp(getReport(e));
exit(1);
end"
disp(getReport(e));
exit(1);
end' > run_tests.m
matlab -batch "run('run_tests.m')"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down

0 comments on commit 66c7974

Please sign in to comment.