|
1 | | -# Run Extension tests |
2 | | - |
3 | 1 | name: test |
4 | 2 |
|
5 | | -# Controls when the workflow will run |
6 | 3 | on: |
7 | | - # Triggers the workflow on push events for the "main" branch |
8 | 4 | push: |
9 | 5 | branches: [ main ] |
10 | | - |
11 | | - # Allows you to run this workflow manually from the Actions tab |
12 | 6 | workflow_dispatch: |
13 | | - |
| 7 | + |
14 | 8 | jobs: |
15 | | - test-smoke: |
16 | | - name: ${{ matrix.version }}-${{ matrix.os }} |
17 | | - runs-on: ${{ matrix.os }} |
| 9 | + build-linux: |
| 10 | + name: build-linux |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - &checkout |
| 14 | + name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: recursive |
| 18 | + - &setup-node |
| 19 | + name: Setup Node.js |
| 20 | + uses: actions/setup-node@v4 |
| 21 | + with: |
| 22 | + node-version: 18.x |
| 23 | + - &install-dependencies |
| 24 | + name: Install dependencies |
| 25 | + run: npm ci |
| 26 | + - &package |
| 27 | + name: Package vsix |
| 28 | + run: npm run package |
| 29 | + - *install-dependencies |
| 30 | + - &setup-test |
| 31 | + name: Setup tests |
| 32 | + run: npm run test-setup |
| 33 | + - name: Upload build artifacts |
| 34 | + uses: actions/upload-artifact@v4 |
| 35 | + if: always() |
| 36 | + with: |
| 37 | + name: build-linux |
| 38 | + path: | |
| 39 | + *.vsix |
| 40 | + out |
| 41 | +
|
| 42 | + build-windows: |
| 43 | + name: build-windows |
| 44 | + runs-on: windows-latest |
| 45 | + steps: |
| 46 | + - *checkout |
| 47 | + - *setup-node |
| 48 | + - *install-dependencies |
| 49 | + - *package |
| 50 | + - *install-dependencies |
| 51 | + - *setup-test |
| 52 | + - name: Upload build artifacts |
| 53 | + uses: actions/upload-artifact@v4 |
| 54 | + if: always() |
| 55 | + with: |
| 56 | + name: build-windows |
| 57 | + path: | |
| 58 | + *.vsix |
| 59 | + out |
| 60 | +
|
| 61 | + build-macos: |
| 62 | + name: build-macos |
| 63 | + runs-on: macos-13 |
| 64 | + steps: |
| 65 | + - *checkout |
| 66 | + - *setup-node |
| 67 | + - *install-dependencies |
| 68 | + - *package |
| 69 | + - *install-dependencies |
| 70 | + - *setup-test |
| 71 | + - name: Upload build artifacts |
| 72 | + uses: actions/upload-artifact@v4 |
| 73 | + if: always() |
| 74 | + with: |
| 75 | + name: build-macos |
| 76 | + path: | |
| 77 | + *.vsix |
| 78 | + out |
| 79 | +
|
| 80 | + # SMOKE TESTS |
| 81 | + test-smoke-linux: |
| 82 | + name: Smoke Test ${{ matrix.version }}-linux |
| 83 | + needs: build-linux |
| 84 | + runs-on: ubuntu-latest |
18 | 85 | strategy: |
19 | 86 | fail-fast: false |
20 | 87 | matrix: |
21 | 88 | version: [R2021b, R2022a, R2022b, latest] |
22 | | - os: [windows-latest, ubuntu-latest, macos-13] |
23 | 89 | steps: |
24 | | - - name: Checkout |
25 | | - uses: actions/checkout@v4 |
| 90 | + - *checkout |
| 91 | + - &download-linux-build-artifacts |
| 92 | + name: Download build artifacts |
| 93 | + uses: actions/download-artifact@v4 |
26 | 94 | with: |
27 | | - submodules: recursive |
28 | | - - name: Set up MATLAB |
| 95 | + name: build-linux |
| 96 | + - &setup-MATLAB |
| 97 | + name: Set up MATLAB |
29 | 98 | uses: matlab-actions/setup-matlab@v2 |
30 | 99 | with: |
31 | 100 | release: ${{ matrix.version }} |
32 | | - - name: Setup node |
33 | | - uses: actions/setup-node@v4 |
34 | | - with: |
35 | | - "node-version": 18.x |
36 | | - - name: npm clean install |
37 | | - run: npm ci |
| 101 | + - *setup-node |
| 102 | + - *install-dependencies |
38 | 103 | - name: Start Xvfb |
39 | 104 | run: /usr/bin/Xvfb :17 -screen 0 1024x768x24 > /dev/null 2>&1 & echo "Started xvfb" |
40 | 105 | shell: bash |
41 | | - if: ${{ success() && matrix.os == 'ubuntu-latest' }} |
42 | | - - name: Package vsix |
43 | | - run: npm run package |
44 | | - - name: npm install |
45 | | - run: npm install |
46 | | - - name: Run UI tests |
47 | | - run: npm run test-ui |
| 106 | + - &run-smoke-tests |
| 107 | + name: Run Smoke tests |
| 108 | + run: npm run test-smoke |
48 | 109 | env: |
49 | 110 | MLM_WEB_LICENSE: true |
50 | | - MLM_WEB_ID: ${{secrets.MLM_WEB_ID}} |
51 | | - MLM_WEB_USER_CRED: ${{secrets.MLM_WEB_USER_CRED}} |
| 111 | + MLM_WEB_ID: ${{ secrets.MLM_WEB_ID }} |
| 112 | + MLM_WEB_USER_CRED: ${{ secrets.MLM_WEB_USER_CRED }} |
52 | 113 | DISPLAY: ":17.0" |
53 | | - if: ${{ success() && matrix.os != 'ubuntu-latest' }} |
54 | | - - name: Run Smoke tests |
55 | | - run: npm run test-smoke |
| 114 | + |
| 115 | + test-smoke-windows: |
| 116 | + name: Smoke Test ${{ matrix.version }}-windows |
| 117 | + needs: build-windows |
| 118 | + runs-on: windows-latest |
| 119 | + strategy: |
| 120 | + fail-fast: false |
| 121 | + matrix: |
| 122 | + version: [R2021b, R2022a, R2022b, latest] |
| 123 | + steps: |
| 124 | + - *checkout |
| 125 | + - &download-windows-build-artifacts |
| 126 | + name: Download build artifacts |
| 127 | + uses: actions/download-artifact@v4 |
| 128 | + with: |
| 129 | + name: build-windows |
| 130 | + - *setup-MATLAB |
| 131 | + - *setup-node |
| 132 | + - *install-dependencies |
| 133 | + - *run-smoke-tests |
| 134 | + |
| 135 | + test-smoke-macos: |
| 136 | + name: Smoke Test ${{ matrix.version }}-macos |
| 137 | + needs: build-macos |
| 138 | + runs-on: macos-13 |
| 139 | + strategy: |
| 140 | + fail-fast: false |
| 141 | + matrix: |
| 142 | + version: [R2021b, R2022a, R2022b, latest] |
| 143 | + steps: |
| 144 | + - *checkout |
| 145 | + - &download-macos-build-artifacts |
| 146 | + name: Download build artifacts |
| 147 | + uses: actions/download-artifact@v4 |
| 148 | + with: |
| 149 | + name: build-macos |
| 150 | + - *setup-MATLAB |
| 151 | + - *setup-node |
| 152 | + - *install-dependencies |
| 153 | + - *run-smoke-tests |
| 154 | + |
| 155 | + # UI TESTS |
| 156 | + test-ui-linux: |
| 157 | + if: False |
| 158 | + name: UI Test ${{ matrix.version }}-linux |
| 159 | + needs: build-linux |
| 160 | + runs-on: ubuntu-latest |
| 161 | + strategy: |
| 162 | + fail-fast: false |
| 163 | + matrix: |
| 164 | + version: [R2021b, R2022a, R2022b, latest] |
| 165 | + steps: |
| 166 | + - *checkout |
| 167 | + - *download-linux-build-artifacts |
| 168 | + - *setup-MATLAB |
| 169 | + - *setup-node |
| 170 | + - *install-dependencies |
| 171 | + - &run-ui-tests |
| 172 | + name: Run UI tests |
| 173 | + run: npm run test-ui |
56 | 174 | env: |
57 | 175 | MLM_WEB_LICENSE: true |
58 | | - MLM_WEB_ID: ${{secrets.MLM_WEB_ID}} |
59 | | - MLM_WEB_USER_CRED: ${{secrets.MLM_WEB_USER_CRED}} |
60 | | - DISPLAY: ":17.0" |
61 | | - |
62 | | - - name: Upload Screenshots |
| 176 | + MLM_WEB_ID: ${{ secrets.MLM_WEB_ID }} |
| 177 | + MLM_WEB_USER_CRED: ${{ secrets.MLM_WEB_USER_CRED }} |
| 178 | + - name: Upload Screenshots |
| 179 | + uses: actions/upload-artifact@v4 |
| 180 | + if: always() |
| 181 | + with: |
| 182 | + name: screenshots-linux-${{ matrix.version }} |
| 183 | + path: .vscode-test/test-resources/screenshots |
| 184 | + if-no-files-found: ignore |
| 185 | + |
| 186 | + test-ui-windows: |
| 187 | + name: UI Test ${{ matrix.version }}-windows |
| 188 | + needs: build-windows |
| 189 | + runs-on: windows-latest |
| 190 | + strategy: |
| 191 | + fail-fast: false |
| 192 | + matrix: |
| 193 | + version: [R2021b, R2022a, R2022b, latest] |
| 194 | + steps: |
| 195 | + - *checkout |
| 196 | + - *download-windows-build-artifacts |
| 197 | + - *setup-MATLAB |
| 198 | + - *setup-node |
| 199 | + - *install-dependencies |
| 200 | + - *run-ui-tests |
| 201 | + - name: Upload Screenshots |
| 202 | + uses: actions/upload-artifact@v4 |
| 203 | + if: always() |
| 204 | + with: |
| 205 | + name: screenshots-windows-${{ matrix.version }} |
| 206 | + path: .vscode-test/test-resources/screenshots |
| 207 | + if-no-files-found: ignore |
| 208 | + |
| 209 | + test-ui-macos: |
| 210 | + name: UI Test ${{ matrix.version }}-macos |
| 211 | + needs: build-macos |
| 212 | + runs-on: macos-latest |
| 213 | + strategy: |
| 214 | + fail-fast: false |
| 215 | + matrix: |
| 216 | + version: [R2021b, R2022a, R2022b, latest] |
| 217 | + steps: |
| 218 | + - *checkout |
| 219 | + - *download-macos-build-artifacts |
| 220 | + - *setup-MATLAB |
| 221 | + - *setup-node |
| 222 | + - *install-dependencies |
| 223 | + - *run-ui-tests |
| 224 | + - name: Upload Screenshots |
63 | 225 | uses: actions/upload-artifact@v4 |
64 | 226 | if: always() |
65 | 227 | with: |
66 | | - name: screenshots-${{ matrix.os }}-${{ matrix.version }} |
| 228 | + name: screenshots-macos-${{ matrix.version }} |
67 | 229 | path: .vscode-test/test-resources/screenshots |
68 | 230 | if-no-files-found: ignore |
0 commit comments