Skip to content

Commit 2ce45ca

Browse files
authored
Update main.yml
Add publish-test-results as separate job.
1 parent 69f9d11 commit 2ce45ca

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
steps:
4040
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4141
- name: Check out repo
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343
with:
4444
submodules: 'recursive'
4545
token: ${{ secrets.REPO_READ_TOKEN }}
@@ -57,30 +57,24 @@ jobs:
5757
# Used to differentiate multiple results for one commit
5858
category: matlab
5959

60-
test:
60+
build-and-test:
6161
strategy:
6262
fail-fast: false # Run with every MATLAB version independently
6363
matrix:
6464
matlabVer: [R2022b, R2023a, R2023b] # List of MATLAB releases to test
65-
6665
runs-on: matlab
6766

6867
# Steps represent a sequence of tasks that will be executed as part of the job
6968
steps:
70-
- name: Setup Python
71-
uses: actions/setup-python@v5
72-
with:
73-
python-version: 3.8
74-
7569
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
7670
- name: Check out repo
77-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
7872
with:
7973
submodules: 'recursive'
8074
token: ${{ secrets.REPO_READ_TOKEN }}
8175

8276
- name: Cache MATLAB build files
83-
uses: actions/cache@v3
77+
uses: actions/cache@v4
8478
with:
8579
key: matlab-buildtool
8680
path: |
@@ -106,14 +100,12 @@ jobs:
106100
#run: |
107101
# &"$env:ProgramFiles\MATLAB\${{ matrix.matlabVer }}\bin\matlab.exe" -batch "openProject(pwd); buildtool test({'noHW','bdConnected'});"
108102

109-
- name: Publish Test Results
110-
uses: EnricoMi/publish-unit-test-result-action/windows@v2
111-
if: success() || failure()
103+
- name: Upload Test Results
104+
if: always()
105+
uses: actions/upload-artifact@v4
112106
with:
113-
check_name: "Test Results ${{ matrix.matlabVer }}"
114-
action_fail: true
115-
files: |
116-
results.xml
107+
name: Test Results (MATLAB ${{ matrix.matlabVer }})
108+
path: results.xml
117109

118110
- name: Upload Speedgoat dependencies as artifacts
119111
if: ${{ github.ref == 'refs/heads/master' }}
@@ -122,3 +114,28 @@ jobs:
122114
name: speedgoat-deps-${{ matrix.matlabVer }}
123115
path: toolbox\dependencies\sg
124116
if-no-files-found: error
117+
118+
publish-test-results:
119+
needs: build-and-test
120+
runs-on: ubuntu-latest
121+
permissions:
122+
checks: write
123+
# only needed unless run with comment_mode: off
124+
pull-requests: write
125+
# only needed for private repository
126+
contents: read
127+
# only needed for private repository
128+
issues: read
129+
if: always()
130+
131+
steps:
132+
- name: Download Test Results
133+
uses: actions/download-artifact@v4
134+
with:
135+
pattern: Test Results*
136+
path: artifacts
137+
138+
- name: Publish Test Results
139+
uses: EnricoMi/publish-unit-test-result-action@v2
140+
with:
141+
files: "artifacts/**/*.xml"

0 commit comments

Comments
 (0)