Update codecov.yml #121
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
with: | |
submodules: false # No need for Git to handle submodules | |
- 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/test/testAll.m'); diary off;" | |
- name: Debug Check If Coverage File Exists | |
run: | | |
ls -l $(pwd) | |
find . -name "CodeCovTestResults.xml" | |
- 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: ${{ github.workspace }}/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 }} |