Skip to content

Commit 4cca75b

Browse files
committed
ci: composite
1 parent 2b149e7 commit 4cca75b

File tree

5 files changed

+50
-39
lines changed

5 files changed

+50
-39
lines changed

.github/workflows/ci-nojvm.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,12 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [ubuntu-latest,macos-latest,windows-latest]
19-
release: [R2024b]
19+
release: [latest]
20+
startup-options: ["-nojvm"]
2021

2122
steps:
22-
23-
- name: Install MATLAB
24-
uses: matlab-actions/setup-matlab@v2
25-
with:
26-
release: ${{ matrix.release }}
27-
2823
- uses: actions/checkout@v4
2924

30-
- name: Run Matlab tests (buildtool)
31-
timeout-minutes: 10
32-
uses: matlab-actions/run-build@v2
33-
with:
34-
startup-options: -nojvm
25+
- uses: ./.github/workflows/composite-install-matlab
26+
27+
- uses: ./.github/workflows/composite-buildtool

.github/workflows/ci.yml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,11 @@ jobs:
3030
release: R2023b
3131

3232
steps:
33-
34-
- name: Install MATLAB
35-
uses: matlab-actions/setup-matlab@v2
36-
with:
37-
release: ${{ matrix.release }}
38-
3933
- uses: actions/checkout@v4
4034

41-
# >= R2022b
42-
- name: Run Matlab tests (buildtool)
43-
if: ${{ matrix.release >= 'R2022b' || matrix.release == 'latest-including-prerelease' }}
44-
timeout-minutes: 10
45-
uses: matlab-actions/run-build@v2
46-
47-
- name: Run tests (manual)
48-
if: ${{ matrix.release < 'R2022b' && matrix.release != 'latest-including-prerelease' }}
49-
timeout-minutes: 10
50-
uses: matlab-actions/run-tests@v2
51-
with:
52-
select-by-folder: test
35+
- uses: ./.github/workflows/composite-install-matlab
5336

37+
- uses: ./.github/workflows/composite-buildtool
5438

5539

5640
prerelease:
@@ -65,14 +49,8 @@ jobs:
6549
release: [latest-including-prerelease]
6650

6751
steps:
68-
69-
- name: Install MATLAB
70-
uses: matlab-actions/setup-matlab@v2
71-
with:
72-
release: ${{ matrix.release }}
73-
7452
- uses: actions/checkout@v4
7553

76-
- name: Run Matlab tests (buildtool)
77-
timeout-minutes: 10
78-
uses: matlab-actions/run-build@v2
54+
- uses: ./.github/workflows/composite-install-matlab
55+
56+
- uses: ./.github/workflows/composite-buildtool
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "matlab-buildtool"
2+
3+
runs:
4+
5+
using: "composite"
6+
7+
steps:
8+
9+
- name: Run Matlab buildtool
10+
if: ${{ matrix.release >= 'R2022b' || matrix.release == 'latest' || matrix.release == 'latest-including-prerelease' }}
11+
timeout-minutes: 10
12+
uses: matlab-actions/run-build@v2
13+
with:
14+
startup-options: ${{ matrix.startup-options }}
15+
tasks: test
16+
17+
18+
- name: Run tests (manual)
19+
if: ${{ matrix.release < 'R2022b' && matrix.release != 'latest' && matrix.release != 'latest-including-prerelease' }}
20+
timeout-minutes: 10
21+
uses: matlab-actions/run-tests@v2
22+
with:
23+
select-by-folder: test
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "install-matlab"
2+
3+
runs:
4+
5+
using: "composite"
6+
7+
steps:
8+
9+
- name: Install MATLAB
10+
uses: matlab-actions/setup-matlab@v2
11+
with:
12+
release: ${{ matrix.release }}
13+
cache: true

buildfile.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
plan("test").Dependencies = "check";
55
end
66

7+
78
function checkTask(~)
89
% Identify code issues (recursively all Matlab .m files)
910
issues = codeIssues;
1011
assert(isempty(issues.Issues), formattedDisplayText(issues.Issues))
1112
end
1213

14+
1315
function testTask(~)
1416
r = runtests('test/', strict=true, UseParallel=false);
1517
% UseParallel can be a lot slower, especially on Mac
1618
assert(~isempty(r), "No tests were run")
1719
assertSuccess(r)
1820
end
1921

22+
2023
function coverageTask(~)
2124
import matlab.unittest.TestRunner
2225
import matlab.unittest.Verbosity
@@ -50,6 +53,7 @@ function coverageTask(~)
5053
generateHTMLReport(format.Result)
5154
end
5255

56+
5357
function publishTask(~)
5458
% publish (generate) docs from Matlab project
5559

0 commit comments

Comments
 (0)