Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b33b46b

Browse files
authoredNov 5, 2024··
Update codecov.yml
1 parent 0f74c1d commit b33b46b

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed
 

‎.github/workflows/codecov.yml‎

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Code Cov CI
1+
name: Code Coverage
22

33
on:
44
push:
@@ -8,31 +8,37 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest # Replace with 'self-hosted' if using your own runner
11+
runs-on: ubuntu-latest
1212

1313
steps:
1414
- uses: actions/checkout@v3
1515

16-
# Set up MATLAB
1716
- name: Set up MATLAB
1817
uses: matlab-actions/setup-matlab@v1
1918
with:
2019
release: R2022a
2120

22-
# Install MOcov
2321
- name: Install MOcov
2422
run: |
2523
git clone https://github.com/MOcov/MOcov.git /opt/MOcov
2624
sudo chmod -R 755 /opt/MOcov
2725
28-
# Run tests and generate coverage with MOcov
29-
- name: Run MATLAB tests and generate MOcov coverage
26+
- name: Run MATLAB tests with coverage
3027
run: |
31-
matlab -batch "addpath('/opt/MOcov'); mocov('-cover', 'src', '-expression', 'result = runtests(\"test\"); assert(all([result.Passed]), \"Some tests failed.\");', '-cover_xml_file', 'coverage.xml', '-method', 'file');"
28+
matlab -batch "
29+
addpath(genpath('/opt/MOcov'));
30+
addpath(genpath('test'));
31+
addpath(genpath('src'));
32+
mocov('start');
33+
results = runtests('test_myfunction.m');
34+
assert(all([results.Passed]), 'Some tests failed');
35+
mocov('stop');
36+
mocov('-cover', 'src', '-cover_xml_file', 'coverage.xml');
37+
exit;"
3238
33-
# Upload coverage report to Codecov
3439
- name: Upload coverage to Codecov
35-
run: |
36-
bash <(curl -s https://codecov.io/bash) -f coverage.xml -F matlab
37-
env:
38-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40+
uses: codecov/codecov-action@v3
41+
with:
42+
files: ./coverage.xml
43+
flags: matlab
44+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)
Please sign in to comment.