Skip to content

Commit f2d9203

Browse files
authored
Run CI on Windows in addition to Linux (#32)
* Use separate GitHub Actions workflow files (.github/workflows/*.yml) for Linux and Windows.
1 parent 8b79bd5 commit f2d9203

File tree

10 files changed

+722
-628
lines changed

10 files changed

+722
-628
lines changed

.github/workflows/ci.yml renamed to .github/workflows/ci-linux.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# For details about the syntax of this file, see
1010
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
1111

12-
# Copyright 2021-2024 The MathWorks, Inc.
12+
# Copyright 2021-2025 The MathWorks, Inc.
1313

14-
name: CI using MATLAB
14+
name: CI using MATLAB on Linux
1515

1616
on:
1717
push:
@@ -41,12 +41,21 @@ on:
4141

4242
jobs:
4343

44-
job-buildtool-24b:
45-
46-
name: Test in R2024b
44+
job-buildtool:
4745

4846
runs-on: ubuntu-latest
4947

48+
# Matrix strategy is used to run the job in various MATLAB versions.
49+
# For information about matrix strategy, see the documentation.
50+
# - Running variations of jobs in a workflow
51+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow
52+
strategy:
53+
matrix:
54+
matlab_version: [R2024b]
55+
#matlab_version: [R2024b, R2025a]
56+
57+
name: Test in ${{ matrix.matlab_version }} on Linux
58+
5059
permissions:
5160
# required for sarif upload
5261
security-events: write
@@ -55,12 +64,12 @@ jobs:
5564
steps:
5665

5766
- name: Check out repository
58-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
5968

60-
- name: Setup MATLAB
69+
- name: Setup MATLAB ${{ matrix.matlab_version }}
6170
uses: matlab-actions/setup-matlab@v2
6271
with:
63-
release: R2024b
72+
release: ${{ matrix.matlab_version }}
6473
cache: true
6574
products: |
6675
Simulink
@@ -69,16 +78,18 @@ jobs:
6978
Simscape_Driveline
7079
Powertrain_Blockset
7180
72-
- name: Start display server
81+
- name: Start display server for running headless Linux with graphics
7382
run: |
7483
sudo apt-get install xvfb
7584
Xvfb :99 &
7685
echo "DISPLAY=:99" >> $GITHUB_ENV
7786
78-
- name: Run buildtool using buildfile.m
79-
uses: matlab-actions/run-command@v1
87+
- name: Run tests via buildtool using buildfile.m
88+
uses: matlab-actions/run-command@v2
8089
with:
81-
command: openProject(pwd); buildtool CodeIssues CheckProject Test
90+
command: |
91+
openProject(pwd);
92+
buildtool CodeIssues CheckProject Test
8293
8394
- name: Upload SARIF file
8495
uses: github/codeql-action/upload-sarif@v3

.github/workflows/ci-windows.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# GitHub Actions Workflow with MATLAB Actions
2+
#
3+
# For a general overview of GitHub Actions, see
4+
# https://docs.github.com/en/actions
5+
#
6+
# For using MathWorks products in GitHub Actions, see
7+
# https://github.com/matlab-actions/overview
8+
#
9+
# For details about the syntax of this file, see
10+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
11+
12+
# Copyright 2025 The MathWorks, Inc.
13+
14+
name: CI using MATLAB on Windows
15+
16+
on:
17+
push:
18+
branches: [ R2024b ]
19+
paths-ignore:
20+
- 'docs/**'
21+
- '**.md'
22+
- '**.png'
23+
- '**.svg'
24+
- '**.txt'
25+
- '**.xml'
26+
27+
pull_request:
28+
branches: [ R2024b ]
29+
paths-ignore:
30+
- 'docs/**'
31+
- '**.md'
32+
- '**.png'
33+
- '**.svg'
34+
- '**.txt'
35+
- '**.xml'
36+
37+
workflow_dispatch:
38+
39+
jobs:
40+
41+
job-buildtool:
42+
43+
runs-on: windows-latest
44+
45+
strategy:
46+
matrix:
47+
matlab_version: [R2024b]
48+
#matlab_version: [R2024b, R2025a]
49+
50+
name: Test in ${{ matrix.matlab_version }} on Windows
51+
52+
steps:
53+
54+
- name: Check out repository
55+
uses: actions/checkout@v4
56+
57+
- name: Setup MATLAB ${{ matrix.matlab_version }}
58+
uses: matlab-actions/setup-matlab@v2
59+
with:
60+
release: ${{ matrix.matlab_version }}
61+
cache: true
62+
products: |
63+
Simulink
64+
Simscape
65+
Simscape_Electrical
66+
Simscape_Driveline
67+
Powertrain_Blockset
68+
69+
- name: Run buildtool using buildfile.m
70+
uses: matlab-actions/run-command@v2
71+
with:
72+
command: |
73+
openProject(pwd);
74+
buildtool CodeIssues CheckProject Test

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## Version 2.4.1 (January 2025)
4+
5+
- GitHub Actions workflow has been updated to use the latest version of
6+
`matlab-actions/setup-matlab@v3` action.
7+
38
## Version 2.4.0 (November, 2024)
49

510
- The project has been updated to MATLAB R2024b with some clean ups.

0 commit comments

Comments
 (0)