-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (67 loc) · 2.67 KB
/
run_tests.yaml
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
name: X-Road-Catalog tests
on:
# Capture this event so that gradle caches are updated when a PR is merged to develop
# More information on why: https://github.com/gradle/gradle-build-action#using-the-caches-read-only
workflow_dispatch:
push:
branches:
- develop
paths:
- 'xroad-catalog-collector/src/**'
- 'xroad-catalog-lister/src/**'
- 'xroad-catalog-persistence/src/**'
- '.github/**'
- 'gradle/**' # So that gradle changes are tested
- 'settings.gradle' # So that gradle changes are tested
- 'build.gradle' # So that gradle changes are tested
- 'gradle.properties' # So that gradle changes are tested
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'xroad-catalog-collector/src/**'
- 'xroad-catalog-lister/src/**'
- 'xroad-catalog-persistence/src/**'
- '.github/**'
- 'gradle/**' # So that gradle changes are tested
- 'settings.gradle' # So that gradle changes are tested
- 'build.gradle' # So that gradle changes are tested
- 'gradle.properties' # So that gradle changes are tested
permissions:
contents: write # Required for https://github.com/gradle/actions/tree/main/setup-gradle#github-dependency-graph-support
pull-requests: write # https://github.com/gradle/actions/tree/main/setup-gradle#adding-job-summary-as-a-pull-request-comment
actions: read # Required for https://github.com/dorny/test-reporter
checks: write # Required for https://github.com/dorny/test-reporter
jobs:
BuildAndTest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
cache-cleanup: always
dependency-graph: generate-and-submit
add-job-summary-as-pr-comment: always
- name: Gradle build environment
run: ./gradlew buildEnvironment xroad-catalog-persistence:buildEnvironment xroad-catalog-collector:buildEnvironment xroad-catalog-lister:buildEnvironment --stacktrace
- name: Run tests
run: ./gradlew build --stacktrace
- name: Test report
env:
NODE_OPTIONS: '--max-old-space-size=6144'
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test results
path: ./**/build/test-results/**/TEST-*.xml
reporter: java-junit
list-suites: 'failed'
list-tests: 'failed'