1- # Build and Test MATLAB VSCode Extension
2-
31name : Build & Test
42
53on :
86 workflow_dispatch :
97
108jobs :
11- build :
12- name : Build VSIX (${{ matrix.os }})
13- runs-on : ${{ matrix.os }}
14- strategy :
15- matrix :
16- os : [windows-latest, ubuntu-latest, macos-13]
9+ build-windows :
10+ name : Build VSIX (windows-latest)
11+ runs-on : windows-latest
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+ with :
16+ submodules : recursive
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : 18.x
22+
23+ - name : Clean install dependencies
24+ run : npm ci
25+
26+ - name : Package vsix
27+ run : npm run package
28+
29+ - name : Install npm dependencies
30+ run : npm install
31+
32+ - name : Setup tests
33+ run : npm run test-setup
34+
35+ - name : Upload build artifacts
36+ uses : actions/upload-artifact@v4
37+ if : always()
38+ with :
39+ name : build-windows-latest
40+ path : |
41+ *.vsix
42+ out
43+
44+ build-ubuntu :
45+ name : Build VSIX (ubuntu-latest)
46+ runs-on : ubuntu-latest
47+ steps :
48+ - name : Checkout
49+ uses : actions/checkout@v4
50+ with :
51+ submodules : recursive
52+
53+ - name : Setup Node.js
54+ uses : actions/setup-node@v4
55+ with :
56+ node-version : 18.x
57+
58+ - name : Clean install dependencies
59+ run : npm ci
60+
61+ - name : Package vsix
62+ run : npm run package
63+
64+ - name : Install npm dependencies
65+ run : npm install
66+
67+ - name : Setup tests
68+ run : npm run test-setup
69+
70+ - name : Upload build artifacts
71+ uses : actions/upload-artifact@v4
72+ if : always()
73+ with :
74+ name : build-ubuntu-latest
75+ path : |
76+ *.vsix
77+ out
78+
79+ build-macos :
80+ name : Build VSIX (macos-13)
81+ runs-on : macos-13
1782 steps :
1883 - name : Checkout
1984 uses : actions/checkout@v4
@@ -41,20 +106,19 @@ jobs:
41106 uses : actions/upload-artifact@v4
42107 if : always()
43108 with :
44- name : build-${{ matrix.os }}
109+ name : build-macos-13
45110 path : |
46111 *.vsix
47112 out
48113
49- test-smoke :
50- name : Test ${{ matrix.version }}-${{ matrix.os }}
51- needs : build
52- runs-on : ${{ matrix.os }}
114+ test-smoke-windows :
115+ name : Test ${{ matrix.version }}-windows-latest
116+ needs : build-windows
117+ runs-on : windows-latest
53118 strategy :
54119 fail-fast : false
55120 matrix :
56121 version : [R2021b, R2022a, R2022b, latest]
57- os : [windows-latest, ubuntu-latest, macos-13]
58122 steps :
59123 - name : Checkout
60124 uses : actions/checkout@v4
64128 - name : Download build artifacts
65129 uses : actions/download-artifact@v4
66130 with :
67- name : build-${{ matrix.os }}
131+ name : build-windows-latest
68132
69133 - name : Set up MATLAB
70134 uses : matlab-actions/setup-matlab@v2
@@ -79,36 +143,12 @@ jobs:
79143 - name : Clean install dependencies
80144 run : npm ci
81145
82- - name : Start Xvfb
83- if : ${{ matrix.os == 'ubuntu-latest' }}
84- run : |
85- /usr/bin/Xvfb :17 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "Started xvfb"
86- shell : bash
87-
88146 - name : Install npm dependencies
89147 run : npm install
90148
91149 - name : Run UI tests
92150 run : npm run test-ui
93- if : ${{ matrix.os != 'ubuntu-latest' }}
94- env :
95- MLM_WEB_LICENSE : true
96- MLM_WEB_ID : ${{ secrets.MLM_WEB_ID }}
97- MLM_WEB_USER_CRED : ${{ secrets.MLM_WEB_USER_CRED }}
98- DISPLAY : " :17.0"
99-
100- - name : Run Smoke tests
101- run : npm run test-smoke
102151 env :
103152 MLM_WEB_LICENSE : true
104153 MLM_WEB_ID : ${{ secrets.MLM_WEB_ID }}
105- MLM_WEB_USER_CRED : ${{ secrets.MLM_WEB_USER_CRED }}
106- DISPLAY : " :17.0"
107-
108- - name : Upload Screenshots
109- uses : actions/upload-artifact@v4
110- if : always()
111- with :
112- name : screenshots-${{ matrix.os }}-${{ matrix.version }}
113- path : .vscode-test/test-resources/screenshots
114- if-no-files-found : ignore
154+ MLM_WEB_USER_CRED : ${{ secrets.MLM_WEB_USER_C
0 commit comments