Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #2414

Merged
merged 12 commits into from
Feb 5, 2025
29 changes: 29 additions & 0 deletions .github/workflows/cobratoolboxCI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Example
on:
pull_request:
branches:
- master
- main
- develop
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Merge base branch into PR
run: |
git fetch origin ${{ github.base_ref }}
git merge origin/${{ github.base_ref }}

- name: Run MATLAB Tests
run: |
matlab -batch "run('initCobraToolbox.m'); run('test/testAll.m');"

- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: testReport.junit.xml
34 changes: 0 additions & 34 deletions .github/workflows/codecov.yml

This file was deleted.

25 changes: 6 additions & 19 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
# codecov.yml

# Comment settings
comment:
layout: "reach, diff, flags, files"
behavior: default # Shows the comment only on the first push of a pull request
require_changes: true # Only comment if there are coverage changes

# Coverage status checks
coverage:
status:
project:
default:
target: auto # Automatically adjust coverage goal
threshold: 1% # Fail PRs that reduce coverage by more than 1%
patch:
default:
target: auto
threshold: 1%

layout: "header, diff, flags, components, files, footer"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false
3 changes: 2 additions & 1 deletion test/testAll.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@
fprintf(['\n > ', num2str(sumFailed), ' tests failed. ', num2str(sumSkipped), ' tests were skipped due to missing requirements.\n\n']);
%% NEW: Generate JUnit XML report for Codecov

xmlFileName = 'CodeCovTestResults.xml';
xmlFileName = 'testReport.junit.xml';

fid = fopen(xmlFileName, 'w');
if fid == -1
error('Could not open file for writing: %s', xmlFileName);
Expand Down