add recursive option to run tests #106
Workflow file for this run
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: tests and coverage with matlab | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
branches: ['*'] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
version: [R2021a, R2021b, R2022a, R2022b] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
fail-fast: false # Don't cancel all jobs if one fails | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install MATLAB | |
uses: matlab-actions/setup-matlab@v1.2.4 | |
with: | |
release: ${{ matrix.version }} | |
- name: Clone spm_2_bids | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 2 | |
- name: Install Moxunit and MOcov | |
run: | | |
git clone https://github.com/MOxUnit/MOxUnit.git --depth 1 | |
git clone https://github.com/MOcov/MOcov.git --depth 1 | |
- name: get bids-matlab and JSONio | |
run: make install_dev | |
- name: Run commands | |
uses: matlab-actions/run-command@v1.1.3 | |
with: | |
command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run tests_matlab; | |
- name: Check logs unix | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
run: grep -q 0 test_report.log || { echo "Some tests failed. Check the 'Run tests' step to know which ones." >&2; exit 1; } | |
- name: Check logs windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
if (-not (Get-Content test_report.log | Select-String -Pattern "0")) { | |
throw "Some tests failed. Check the 'Run tests' step to know which ones." | |
} | |
- name: Code coverage | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
uses: codecov/codecov-action@v3 | |
with: | |
file: coverage.xml | |
flags: ${{ matrix.os }}_matlab-${{ matrix.version }} | |
with_coverage: true | |
cover_xml_file: coverage.xml |