Update codecov.yml #51
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: 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 MOxUnit and MOcov | |
- name: Install MOxUnit and MOcov | |
run: | | |
git clone https://github.com/MOxUnit/MOxUnit.git /opt/MOxUnit | |
git clone https://github.com/MOcov/MOcov.git /opt/MOcov | |
# Run MATLAB tests with MOxUnit and generate coverage | |
- name: Run MATLAB tests and generate MOcov coverage | |
run: | | |
matlab -batch "addpath('/opt/MOxUnit/MOxUnit'); addpath('/opt/MOcov/MOcov'); moxunit_runtests('test/test_myfunction.m', '-verbose', '-with_coverage', '-cover', 'src', '-cover_xml_file', 'coverage.xml');" | |
# 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 }} |