-
Notifications
You must be signed in to change notification settings - Fork 319
50 lines (41 loc) · 1.3 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
39
40
41
42
43
44
45
46
47
48
49
50
name: MATLAB Tests and Code Coverage
on:
pull_request:
branches:
- '**'
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout PR Code
uses: actions/checkout@v4
- name: Merge PR with Develop
run: |
git fetch origin develop
git checkout -b test-branch
git merge origin/develop --no-edit
- name: Clone COBRA Toolbox
run: |
git clone https://github.com/opencobra/cobratoolbox.git cobratoolbox
- name: Run MATLAB Tests
run: |
matlab -batch "run('cobratoolbox/initCobraToolbox.m'); diary('test_results.txt'); run('cobratoolbox/testAll.m'); diary off;"
- name: Upload Test Report
uses: actions/upload-artifact@v4
with:
name: test-report
path: test_results.txt
- name: Upload Coverage to Codecov
if: always() # Ensure it runs even if tests fail
uses: codecov/codecov-action@v3
with:
files: CodeCovTestResults.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: matlab
comment: true
- name: Upload Test Results to Codecov
if: always()
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}