Skip to content

Merge pull request #2394 from farid-zare/CI #118

Merge pull request #2394 from farid-zare/CI

Merge pull request #2394 from farid-zare/CI #118

Workflow file for this run

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: recursive # Ensures GitHub Actions checks out submodules properly
- name: Initialize and Update Submodules
run: |
git submodule deinit --all --force # Remove broken submodules
git submodule update --init --recursive --force
git submodule sync --recursive
- name: Merge PR with Develop
run: |
git fetch origin develop
git checkout -b test-branch
git merge origin/develop --allow-unrelated-histories --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: Debug: Check If Coverage File Exists

Check failure on line 37 in .github/workflows/codecov.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/codecov.yml

Invalid workflow file

You have an error in your yaml syntax on line 37
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 }}