Keycloak
46 строк · 1.6 Кб
1name: Archive Surefire reports
2description: It will upload and archive surefire reports per particular test run.
3inputs:
4job-id:
5description: 'Id of the particular job run.'
6required: true
7release-branches:
8description: 'List of all related release branches (in JSON format)'
9required: false
10default: '["refs/heads/release/22.0"]'
11keep-days:
12description: 'For how many days to store the particular artifact.'
13required: false
14default: 1
15
16runs:
17using: composite
18steps:
19- id: find-surefire-reports-linux
20name: Find Surefire reports directories
21if: runner.os == 'Linux'
22shell: bash
23run: |
24echo "dirs<<EOF" >> $GITHUB_OUTPUT
25echo "$(find ~+ -type d -not -empty -name surefire-reports*)" >> $GITHUB_OUTPUT
26echo "EOF" >> $GITHUB_OUTPUT
27
28- id: find-surefire-reports-win
29name: Find Surefire reports directories
30if: runner.os == 'Windows'
31shell: bash
32run: |
33echo "dirs<<EOF" >> $GITHUB_OUTPUT
34echo "$(find ~+ -type d -not -empty -name surefire-reports* | sed 's@/d@D:@')" >> $GITHUB_OUTPUT
35echo "EOF" >> $GITHUB_OUTPUT
36
37- id: upload-surefire-linux
38name: Upload Surefire reports
39if: (!cancelled() && contains(fromJSON(inputs.release-branches), github.ref) && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name))
40uses: actions/upload-artifact@v3
41with:
42name: surefire-${{ inputs.job-id }}
43path: |
44${{ steps.find-surefire-reports-linux.outputs.dirs }}
45${{ steps.find-surefire-reports-win.outputs.dirs }}
46retention-days: ${{ inputs.keep-days }}
47