-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 3.16 KB
/
testext-ci.yml
File metadata and controls
100 lines (86 loc) · 3.16 KB
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
name: Test Framework Extensions CI
on:
push:
branches: [main]
tags:
- 'v*'
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: write
env:
DOCMAKER_GITHUB_TOKEN: ${{ secrets.DOCMAKER_GITHUB_TOKEN }}
jobs:
run-tests:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
matlab-version: [R2023b, R2024b, R2025b, R2026a]
runs-on: ${{ matrix.platform }}
continue-on-error: false
steps:
- name: Check out the repository
uses: actions/checkout@v6
- name: Start a display server for jobs running on Linux
if: ${{ matrix.platform == 'ubuntu-latest' }}
run: |
sudo apt-get install -y xvfb
Xvfb :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Set up MATLAB on the runner
uses: matlab-actions/setup-matlab@v3
with:
products: |
MATLAB
Simulink
Parallel_Computing_Toolbox
release: ${{ matrix.matlab-version }}
- name: Run the toolbox tests
uses: matlab-actions/run-tests@v3
package-and-release-toolbox:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v6
- name: Extract version from tag
shell: bash
run: |
TOOLBOX_VERSION="${GITHUB_REF_NAME#v}"
echo "TOOLBOX_VERSION=$TOOLBOX_VERSION" >> $GITHUB_ENV
- name: Set up MATLAB on the runner
uses: matlab-actions/setup-matlab@v3
with:
products: MATLAB
release: R2026a
- name: Package toolbox
uses: matlab-actions/run-command@v3
with:
command: |
% Download and install DocMaker
toolboxFile = websave( "MATLAB_DocMaker.mltbx", "https://github.com/mathworks/docmaker/releases/latest/download/MATLAB_DocMaker.mltbx" );
fileCleanup = onCleanup( @() delete( toolboxFile ) );
matlab.addons.install( toolboxFile, true );
% Extract the latest release notes
logLines = readlines( "tbx/testextdoc/Changelog.md" );
startIdx = find( logLines == "## Version " + getenv( "TOOLBOX_VERSION" ) );
allVersionLines = find( startsWith( logLines, "##" ) );
endIdx = allVersionLines(find( allVersionLines > startIdx, 1 )) - 1;
releaseNotes = join( logLines(startIdx:endIdx), newline() );
systemCommand = sprintf( [ ...
'echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV && ', ...
'echo "%s" >> $GITHUB_ENV && ', ...
'echo "EOF" >> $GITHUB_ENV'], releaseNotes );
system( systemCommand );
% Package the toolbox
buildtool package -skip test -skip check
- name: Release toolbox
uses: softprops/action-gh-release@v3
with:
name: Test Framework Extensions ${{ env.TOOLBOX_VERSION }}
tag_name: v${{ env.TOOLBOX_VERSION }}
body: ${{ env.RELEASE_NOTES }}
draft: false
make_latest: true
files: releases/TestFrameworkExtensions.mltbx