|
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 2021-2025 The MathWorks, Inc. |
13 | | - |
14 | | -name: CI using MATLAB on Linux |
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 | | -# schedule: |
38 | | -# - cron: '55/61 20/25 1/6 * *' # schedule a weekly-ish build |
39 | | - |
40 | | - workflow_dispatch: |
41 | | - |
42 | | -jobs: |
43 | | - |
44 | | - job-buildtool: |
45 | | - |
46 | | - runs-on: ubuntu-latest |
47 | | - |
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 | | - |
59 | | - permissions: |
60 | | - # required for sarif upload |
61 | | - security-events: write |
62 | | - checks: write # required for junit test result publishing |
63 | | - |
64 | | - steps: |
65 | | - |
66 | | - - name: Check out repository |
67 | | - uses: actions/checkout@v4 |
68 | | - |
69 | | - - name: Setup MATLAB ${{ matrix.matlab_version }} |
70 | | - uses: matlab-actions/setup-matlab@v2 |
71 | | - with: |
72 | | - release: ${{ matrix.matlab_version }} |
73 | | - cache: true |
74 | | - products: | |
75 | | - Simulink |
76 | | - Simscape |
77 | | - Simscape_Electrical |
78 | | - Simscape_Driveline |
79 | | - Powertrain_Blockset |
80 | | -
|
81 | | - - name: Start display server for running headless Linux with graphics |
82 | | - run: | |
83 | | - sudo apt-get install xvfb |
84 | | - Xvfb :99 & |
85 | | - echo "DISPLAY=:99" >> $GITHUB_ENV |
86 | | -
|
87 | | - - name: Run tests via buildtool using buildfile.m |
88 | | - uses: matlab-actions/run-command@v2 |
89 | | - with: |
90 | | - command: | |
91 | | - openProject(pwd); |
92 | | - buildtool CodeIssues CheckProject Test |
93 | | -
|
94 | | - - name: Upload SARIF file |
95 | | - uses: github/codeql-action/upload-sarif@v3 |
96 | | - if: always() |
97 | | - with: |
98 | | - sarif_file: cache/buildtool-results/code-issues.sarif |
99 | | - category: matlab-analysis |
100 | | - |
101 | | - - name: Publish Test Report |
102 | | - uses: mikepenz/action-junit-report@v4 |
103 | | - if: always() |
104 | | - with: |
105 | | - report_paths: 'cache/buildtool-results/test-results.xml' |
106 | | - |
107 | | - - name: Upload Test Report |
108 | | - if: always() |
109 | | - uses: actions/upload-artifact@v4 |
110 | | - with: |
111 | | - name: Test Results |
112 | | - path: cache/buildtool-results/test-results.pdf |
113 | | - |
114 | | - - name: Upload All Artifacts |
115 | | - if: always() |
116 | | - uses: actions/upload-artifact@v4 |
117 | | - with: |
118 | | - name: All Artifacts |
119 | | - path: cache/buildtool-results |
120 | | - |
121 | | - - name: Publish coverage |
122 | | - uses: 5monkeys/cobertura-action@master |
123 | | - continue-on-error: true |
124 | | - with: |
125 | | - path: cache/buildtool-results/code-coverage.xml |
126 | | - minimum_coverage: 75 |
| 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 2021-2025 The MathWorks, Inc. |
| 13 | + |
| 14 | +name: CI using MATLAB on Linux |
| 15 | + |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: [ R2025a ] |
| 19 | + paths-ignore: |
| 20 | + - 'docs/**' |
| 21 | + - '**.md' |
| 22 | + - '**.png' |
| 23 | + - '**.svg' |
| 24 | + - '**.txt' |
| 25 | + - '**.xml' |
| 26 | + |
| 27 | + pull_request: |
| 28 | + branches: [ R2025a ] |
| 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: ubuntu-latest |
| 44 | + |
| 45 | + # Matrix strategy is used to run the job in various MATLAB versions. |
| 46 | + # For information about matrix strategy, see the documentation. |
| 47 | + # - Running variations of jobs in a workflow |
| 48 | + # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + matlab_version: [R2025a] |
| 52 | + #matlab_version: [R2025a, R2025b] |
| 53 | + |
| 54 | + name: Test in ${{ matrix.matlab_version }} on Linux |
| 55 | + |
| 56 | + permissions: |
| 57 | + # required for sarif upload |
| 58 | + security-events: write |
| 59 | + checks: write # required for junit test result publishing |
| 60 | + |
| 61 | + steps: |
| 62 | + |
| 63 | + - name: Check out repository |
| 64 | + uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Setup MATLAB ${{ matrix.matlab_version }} |
| 67 | + uses: matlab-actions/setup-matlab@v2 |
| 68 | + with: |
| 69 | + release: ${{ matrix.matlab_version }} |
| 70 | + cache: true |
| 71 | + products: | |
| 72 | + Simulink |
| 73 | + Simscape |
| 74 | + Simscape_Electrical |
| 75 | + Simscape_Driveline |
| 76 | + Powertrain_Blockset |
| 77 | +
|
| 78 | + - name: Start display server for running headless Linux with graphics |
| 79 | + run: | |
| 80 | + sudo apt-get install xvfb |
| 81 | + Xvfb :99 & |
| 82 | + echo "DISPLAY=:99" >> $GITHUB_ENV |
| 83 | +
|
| 84 | + - name: Run tests via buildtool using buildfile.m |
| 85 | + uses: matlab-actions/run-command@v2 |
| 86 | + with: |
| 87 | + command: | |
| 88 | + openProject(pwd); |
| 89 | + buildtool CodeIssues CheckProject Test |
| 90 | +
|
| 91 | + - name: Upload SARIF file |
| 92 | + uses: github/codeql-action/upload-sarif@v3 |
| 93 | + if: always() |
| 94 | + with: |
| 95 | + sarif_file: cache/buildtool-results/code-issues.sarif |
| 96 | + category: matlab-analysis |
| 97 | + |
| 98 | + - name: Publish Test Report |
| 99 | + uses: mikepenz/action-junit-report@v4 |
| 100 | + if: always() |
| 101 | + with: |
| 102 | + report_paths: 'cache/buildtool-results/test-results.xml' |
| 103 | + |
| 104 | + - name: Upload Test Report |
| 105 | + if: always() |
| 106 | + uses: actions/upload-artifact@v4 |
| 107 | + with: |
| 108 | + name: Test Results |
| 109 | + path: cache/buildtool-results/test-results.pdf |
| 110 | + |
| 111 | + - name: Upload All Artifacts |
| 112 | + if: always() |
| 113 | + uses: actions/upload-artifact@v4 |
| 114 | + with: |
| 115 | + name: All Artifacts |
| 116 | + path: cache/buildtool-results |
| 117 | + |
| 118 | + - name: Publish coverage |
| 119 | + uses: 5monkeys/cobertura-action@master |
| 120 | + continue-on-error: true |
| 121 | + with: |
| 122 | + path: cache/buildtool-results/code-coverage.xml |
| 123 | + minimum_coverage: 75 |
0 commit comments