-
Notifications
You must be signed in to change notification settings - Fork 3
134 lines (116 loc) · 3.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
paths-ignore:
- 'README.md'
- '.github/workflows/release.yml'
- '.github/workflows/doc.yml'
- 'docSource/**'
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow calling it from another workflow
workflow_call:
secrets:
REPO_READ_TOKEN:
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.REPO_READ_TOKEN }}
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
- name: Run MATLAB build
uses: matlab-actions/run-build@v2
with:
tasks: check
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
# Optional category for the results
# Used to differentiate multiple results for one commit
category: matlab
test:
strategy:
fail-fast: false # Run with every MATLAB version independently
matrix:
matlabVer: [R2024a] # List of MATLAB releases to test
runs-on: matlab
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
token: ${{ secrets.REPO_READ_TOKEN }}
- name: Cache MATLAB build files
uses: actions/cache@v4
with:
key: matlab-buildtool
path: |
.buildtool
- name: Download firmware artifact
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.REPO_READ_TOKEN }}
workflow: main.yml
repo: sync2brain/bossdevice-firmware
branch: main
search_artifacts: true
name: bossdevice-firmware-${{ matrix.matlabVer }}
path: work
if_no_artifact_found: fail
- name: Prepend MATLAB to PATH on Windows (PowerShell)
if: runner.os == 'Windows'
run: echo "$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Run MATLAB build
uses: matlab-actions/run-build@v2
timeout-minutes: 15
with:
tasks: test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (MATLAB ${{ matrix.matlabVer }})
path: results.xml
- name: Upload Speedgoat dependencies as artifacts
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v4
with:
name: speedgoat-deps-${{ matrix.matlabVer }}
path: toolbox\dependencies\sg
if-no-files-found: error
publish-test-results:
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
# only needed unless run with comment_mode: off
pull-requests: write
if: always()
steps:
- name: Download Test Results
uses: actions/download-artifact@v4
with:
pattern: Test Results*
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/*.xml"