-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.46 KB
/
test.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
name: 'Integration Test'
on:
workflow_dispatch:
schedule:
# When updating the cron schedule here, be sure to also change the user from
# `github.actor` to either `github.repository_owner` or a hard-coded value.
#
# This is because the latest user who creates the schedule trigger will be
# the actor for the schedule workflow, see
# <https://github.com/orgs/community/discussions/25067> for more details.
- cron: 30 16 * * * # 16:30 UTC (19:30 MSK), daily.
jobs:
test:
name: 'Integration Test'
runs-on: ubuntu-latest
# A possible workaround for <https://github.com/dorny/test-reporter/issues/168>.
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
steps:
- uses: actions/checkout@v4
- name: 'Set up Java 17'
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
java-package: jdk+fx
cache: gradle
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 'Execute Gradle build'
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
-Dsave-cloud.backend.url=https://saveourtool.com
-Dsave-cloud.user=${{ secrets.SAVE_CLOUD_USER }}
-Dsave-cloud.password=${{ secrets.SAVE_CLOUD_PASSWORD }}
-Dsave-cloud.project.name=Diktat-Integration
-Dsave-cloud.contest.name=Integration-Tests
-Dsave-cloud.test.version=save-integration-test
build
# This step needs a Git repository, so it's impossible to extract it
# into a separate job (or, otherwise, we'd need to upload the content
# of the whole `.git` folder as an artifact).
- name: 'JUnit Tests (dorny/test-reporter)'
uses: dorny/test-reporter@v1
if: ${{ always() }}
with:
name: 'JUnit Tests (dorny/test-reporter)'
# Comma-separated values.
path: "**/build/test-results/*/TEST-*.xml"
reporter: java-junit
# Ignore the "Resource not accessible by integration" error when a PR
# originates from a non-collaborator. This is
# <https://github.com/dorny/test-reporter/issues/168> which may be
# potentially fixed with <https://github.com/dorny/test-reporter/pull/174>.
continue-on-error: true
- name: 'Upload test results'
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: xml-test-reports
path: |
**/build/test-results/*/TEST-*.xml
retention-days: 1
report:
name: 'Publish JUnit test results'
if: ${{ always() }}
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/download-artifact@v3
if: ${{ always() }}
with:
name: xml-test-reports
# Uses Docker, that's why Linux-only.
- name: 'JUnit Tests (EnricoMi/publish-unit-test-result-action)'
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: 'JUnit Tests (EnricoMi/publish-unit-test-result-action)'
files: |
**/build/test-results/*/TEST-*.xml