diff --git a/.github/workflows/ci-nojvm.yml b/.github/workflows/ci-nojvm.yml index 7ec8b94..6823639 100644 --- a/.github/workflows/ci-nojvm.yml +++ b/.github/workflows/ci-nojvm.yml @@ -16,19 +16,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest,macos-latest,windows-latest] - release: [R2024b] + release: [latest] + startup-options: ["-nojvm"] steps: - - - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 - with: - release: ${{ matrix.release }} - - uses: actions/checkout@v4 - - name: Run Matlab tests (buildtool) - timeout-minutes: 10 - uses: matlab-actions/run-build@v2 - with: - startup-options: -nojvm + - uses: ./.github/workflows/composite-install-matlab + + - uses: ./.github/workflows/composite-buildtool diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bffa032..55ecef2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,27 +30,11 @@ jobs: release: R2023b steps: - - - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 - with: - release: ${{ matrix.release }} - - uses: actions/checkout@v4 - # >= R2022b - - name: Run Matlab tests (buildtool) - if: ${{ matrix.release >= 'R2022b' || matrix.release == 'latest-including-prerelease' }} - timeout-minutes: 10 - uses: matlab-actions/run-build@v2 - - - name: Run tests (manual) - if: ${{ matrix.release < 'R2022b' && matrix.release != 'latest-including-prerelease' }} - timeout-minutes: 10 - uses: matlab-actions/run-tests@v2 - with: - select-by-folder: test + - uses: ./.github/workflows/composite-install-matlab + - uses: ./.github/workflows/composite-buildtool prerelease: @@ -65,14 +49,8 @@ jobs: release: [latest-including-prerelease] steps: - - - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 - with: - release: ${{ matrix.release }} - - uses: actions/checkout@v4 - - name: Run Matlab tests (buildtool) - timeout-minutes: 10 - uses: matlab-actions/run-build@v2 + - uses: ./.github/workflows/composite-install-matlab + + - uses: ./.github/workflows/composite-buildtool diff --git a/.github/workflows/composite-buildtool/action.yml b/.github/workflows/composite-buildtool/action.yml new file mode 100644 index 0000000..205907a --- /dev/null +++ b/.github/workflows/composite-buildtool/action.yml @@ -0,0 +1,23 @@ +name: "matlab-buildtool" + +runs: + + using: "composite" + + steps: + + - name: Run Matlab buildtool + if: ${{ matrix.release >= 'R2022b' || matrix.release == 'latest' || matrix.release == 'latest-including-prerelease' }} + timeout-minutes: 10 + uses: matlab-actions/run-build@v2 + with: + startup-options: ${{ matrix.startup-options }} + tasks: test + + + - name: Run tests (manual) + if: ${{ matrix.release < 'R2022b' && matrix.release != 'latest' && matrix.release != 'latest-including-prerelease' }} + timeout-minutes: 10 + uses: matlab-actions/run-tests@v2 + with: + select-by-folder: test diff --git a/.github/workflows/composite-install-matlab/action.yml b/.github/workflows/composite-install-matlab/action.yml new file mode 100644 index 0000000..0d5590b --- /dev/null +++ b/.github/workflows/composite-install-matlab/action.yml @@ -0,0 +1,13 @@ +name: "install-matlab" + +runs: + + using: "composite" + + steps: + + - name: Install MATLAB + uses: matlab-actions/setup-matlab@v2 + with: + release: ${{ matrix.release }} + cache: true diff --git a/buildfile.m b/buildfile.m index fb5fefe..26e8116 100644 --- a/buildfile.m +++ b/buildfile.m @@ -4,12 +4,14 @@ plan("test").Dependencies = "check"; end + function checkTask(~) % Identify code issues (recursively all Matlab .m files) issues = codeIssues; assert(isempty(issues.Issues), formattedDisplayText(issues.Issues)) end + function testTask(~) r = runtests('test/', strict=true, UseParallel=false); % UseParallel can be a lot slower, especially on Mac @@ -17,6 +19,7 @@ function testTask(~) assertSuccess(r) end + function coverageTask(~) import matlab.unittest.TestRunner import matlab.unittest.Verbosity @@ -50,6 +53,7 @@ function coverageTask(~) generateHTMLReport(format.Result) end + function publishTask(~) % publish (generate) docs from Matlab project