forked from blockwise-direct-search/bds
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.35 KB
/
unit_test_coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}