MIT license #19
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: MATLAB Tests | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
matlab-test: | |
name: MATLAB Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ["R2020a", "R2020b", "R2021a", "R2021b", "R2022a", "R2022b", "R2023a"] | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
exclude: | |
- os: windows-latest | |
version: "R2020a" # MATLAB not available | |
- os: windows-latest | |
version: "R2020b" # MATLAB not available | |
- os: windows-latest | |
version: "R2021a" # Compiler not available | |
- os: windows-latest | |
version: "R2021b" # Compiler not available | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up MATLAB | |
uses: matlab-actions/setup-matlab@v1 | |
with: | |
release: ${{matrix.version}} | |
- name: Run tests with existing MEX files | |
uses: matlab-actions/run-command@v1 | |
with: | |
command: addpath(pwd); cd tests; results = gifti_runtests; assert(all(~[results.Failed])); | |
- name: Compile GIfTI MEX files | |
run: | | |
make -C @gifti/private distclean | |
make -C @gifti/private | |
- name: Run tests with newly compiled MEX files | |
uses: matlab-actions/run-command@v1 | |
with: | |
command: addpath(pwd); cd tests; results = gifti_runtests; assert(all(~[results.Failed])); | |
- name: Get MEX extension on Linux/macOS | |
if: runner.os != 'Windows' | |
run: echo "MEXEXT=$(mexext)" >> $GITHUB_ENV | |
- name: Get MEX extension on Windows | |
if: runner.os == 'Windows' | |
run: echo "MEXEXT=$(mexext.bat)" >> $env:GITHUB_ENV | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gifti-${{env.MEXEXT}}-${{runner.os}}-${{matrix.version}} | |
path: ./**/*.${{env.MEXEXT}} | |
retention-days: 5 |