1- name : " MATLAB: test and coverage"
1+ ---
2+ name : ' MATLAB: test and coverage'
23
34# Installs
45# - MATLAB github action
@@ -11,9 +12,9 @@ name: "MATLAB: test and coverage"
1112
1213on :
1314 push :
14- branches : [" master", " main", " dev" ]
15+ branches : [master, main, dev]
1516 pull_request :
16- branches : ["*" ]
17+ branches : ['*' ]
1718
1819jobs :
1920 matlab_tests :
@@ -27,36 +28,40 @@ jobs:
2728 runs-on : ${{ matrix.os }}
2829
2930 steps :
30- - name : Install MATLAB
31- uses :
matlab-actions/[email protected] 32- with :
33- release : ${{ matrix.version }}
34-
35- - uses : actions/checkout@v3
36- with :
37- submodules : true
38- fetch-depth : 1
39-
40- - name : Install Moxunit and MOcov
41- run : |
42- git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
43- git clone https://github.com/MOcov/MOcov.git --depth 1
44-
45- - name : Run tests
46- uses :
matlab-actions/[email protected] 47- with :
48- command :
49- cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows'));
50- run run_tests_ci;
51-
52- - name : Check logs
53- run : |
54- cat test_report.log | grep 0
55-
56- - name : Code coverage
57- uses : codecov/codecov-action@v3
58- with :
59- file : coverage.xml # optional
60- flags : matlab # optional
61- name : codecov-umbrella # optional
62- fail_ci_if_error : true # optional (default = false)
31+ - name : Install MATLAB
32+ uses :
matlab-actions/[email protected] 33+ with :
34+ release : ${{ matrix.version }}
35+
36+ - uses : actions/checkout@v3
37+ with :
38+ submodules : true
39+ fetch-depth : 1
40+
41+ - name : Install Moxunit and MOcov
42+ run : |
43+ git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
44+ git clone https://github.com/MOcov/MOcov.git --depth 1
45+
46+ - name : Run tests
47+ uses :
matlab-actions/[email protected] 48+ with :
49+ command : cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run run_tests_ci;
50+
51+ - name : Check logs unix
52+ if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
53+ run : grep -q 0 test_report.log || { echo "Some tests failed. Check the 'Run tests' step to know which ones." >&2; exit 1; }
54+ - name : Check logs windows
55+ if : matrix.os == 'windows-latest'
56+ run : |
57+ if (-not (Get-Content test_report.log | Select-String -Pattern "0")) {
58+ throw "Some tests failed. Check the 'Run tests' step to know which ones."
59+ }
60+
61+ - name : Code coverage
62+ uses : codecov/codecov-action@v3
63+ with :
64+ file : coverage.xml # optional
65+ flags : matlab # optional
66+ name : codecov-umbrella # optional
67+ fail_ci_if_error : true # optional (default = false)
0 commit comments