-
Notifications
You must be signed in to change notification settings - Fork 12
56 lines (56 loc) · 1.94 KB
/
matlab.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
51
52
53
54
55
56
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", "R2023b"]
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