8
8
branches : [ release ]
9
9
workflow_dispatch :
10
10
11
+ # Add permission to write GitHub pages
12
+ permissions :
13
+ contents : write
14
+ pages : write
15
+ id-token : write
16
+
11
17
jobs :
12
18
test :
13
19
strategy :
14
20
fail-fast : false
15
21
matrix :
16
- MATLABVersion : [R2021a,R2021b,R2022a,R2022b,R2023a,R2023b ]
22
+ MATLABVersion : [R2024a,R2024b ]
17
23
runs-on : ubuntu-latest
18
24
steps :
19
25
# Checks-out your repository
20
- - uses : actions/checkout@v3
26
+ - uses : actions/checkout@v4
27
+
28
+ # Sets up a display server
29
+ - name : Start display server
30
+ if : ${{ always() }}
31
+ run : |
32
+ sudo apt-get install xvfb
33
+ Xvfb :99 &
34
+ echo "DISPLAY=:99" >> $GITHUB_ENV
21
35
22
36
# Sets up MATLAB
23
37
- name : Setup MATLAB
24
- uses : matlab-actions/setup-matlab@v1
38
+ uses : matlab-actions/setup-matlab@v2
25
39
with :
26
40
release : ${{ matrix.MATLABVersion }}
41
+ products : Simulink Simscape
42
+
27
43
28
44
# Run all the tests
29
45
- name : Run SmokeTests
30
- uses : matlab-actions/run-command@v1
46
+ uses : matlab-actions/run-command@v2
31
47
with :
32
48
command : openProject(pwd); RunAllTests;
33
49
34
50
# Upload the test results as artifact
35
51
- name : Upload TestResults
36
-
52
+ if : ${{ always() }}
53
+ uses : actions/upload-artifact@v4
37
54
with :
38
- name : TestResults
39
- path : ./SoftwareTests/TestResults_${{ matrix.MATLABVersion }}.txt
55
+ name : TestResults_${{ matrix.MATLABVersion }}
56
+ path : ./public/*
57
+ overwrite : true
40
58
41
59
badge :
42
60
if : ${{ always() }}
@@ -47,26 +65,38 @@ jobs:
47
65
steps :
48
66
49
67
# Checks-out your repository
50
- - uses : actions/checkout@v3
68
+ - uses : actions/checkout@v4
51
69
52
70
# Sets up R2023b
53
71
- name : Setup MATLAB
54
- uses : matlab-actions/setup-matlab@v1
72
+ uses : matlab-actions/setup-matlab@v2
55
73
with :
56
- release : R2023b
74
+ release : R2024b
57
75
58
76
# Download the test results from artifact
59
- - name : Download TestResults
60
- uses : actions/download-artifact@v2.1.1
77
+ - name : Download All TestResults
78
+ uses : actions/download-artifact@v4
61
79
with :
62
- name : TestResults
63
- path : ./SoftwareTests/
64
-
80
+ path : public
81
+ pattern : TestResults_*
82
+ merge-multiple : true
83
+
65
84
# Create the test results badge
66
- - name : Run CreateBadge
67
- uses : matlab-actions/run-command@v1
85
+ - name : Run PostSmokeTest
86
+ uses : matlab-actions/run-command@v2
87
+ with :
88
+ command : openProject(pwd); PostSmokeTest;
89
+
90
+ # Deploy reports to GitHub pages
91
+ - name : Setup Pages
92
+ uses : actions/configure-pages@v5
93
+ - name : Upload pages artifact
94
+ uses : actions/upload-pages-artifact@v3
68
95
with :
69
- command : openProject(pwd); CreateBadge;
96
+ path : public
97
+ - name : Deploy to GitHub Pages
98
+ id : deployment
99
+ uses : actions/deploy-pages@v4
70
100
71
101
# Commit the JSON for the MATLAB releases badge
72
102
- name : Commit changed files
75
105
git config user.name "${{ github.workflow }} by ${{ github.actor }}"
76
106
git config user.email "<>"
77
107
git pull
108
+ git add Images/TestedWith.json
78
109
git commit Images/TestedWith.json -m "Update CI badges ${{ github.ref_name }}"
79
110
git fetch
80
111
git push
0 commit comments