Include all the workflows #3
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: Coverage of unit test | |
on: push | |
jobs: | |
run: | |
name: Generate coverage report for MATLAB ${{ matrix.matlab }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
matlab: [latest] | |
with_optim_toolbox: [yes] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Cache MATLAB # N.B.: Clear the cache when the `latest` version of MATLAB changes in March and September | |
uses: actions/cache@v3.3.2 | |
with: | |
path: ${{ runner.tool_cache }}/MATLAB | |
key: ${{ matrix.os }}-${{ matrix.matlab }} | |
- name: Set up MATLAB with optimization toolbox | |
if: ${{ matrix.with_optim_toolbox == 'yes' }} | |
uses: matlab-actions/setup-matlab@v2 | |
with: | |
release: ${{ matrix.matlab }} | |
products: Optimization_Toolbox Parallel_Computing_Toolbox | |
- name: Setup BDS and run tests | |
uses: matlab-actions/run-command@v2.1.1 | |
with: | |
command: | | |
% Run tests | |
root_dir = pwd() | |
setup | |
path_tests = fullfile(root_dir, 'tests'); | |
cd(path_tests) | |
runTests | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |