-
Notifications
You must be signed in to change notification settings - Fork 320
38 lines (31 loc) · 1.11 KB
/
codecov.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Code Cov CI
on:
push:
branches: [develop]
pull_request:
branches: [develop]
jobs:
test:
runs-on: ubuntu-latest # Replace with 'self-hosted' if using your own runner
steps:
- uses: actions/checkout@v3
# Set up MATLAB
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2022a
# Install MOcov
- name: Install MOcov
run: |
git clone https://github.com/MOcov/MOcov.git /opt/MOcov
sudo chmod -R 755 /opt/MOcov
# Run tests and generate coverage with MOcov
- name: Run MATLAB tests and generate MOcov coverage
run: |
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');"
# Upload coverage report to Codecov
- name: Upload coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash) -f coverage.xml -F matlab
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}