-
Notifications
You must be signed in to change notification settings - Fork 12
149 lines (149 loc) · 5.46 KB
/
ci.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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: CI
on:
# allow to manually trigger a build through the Actions tab
workflow_dispatch:
# trigger build on PR
pull_request:
# trigger build when a branch is pushed
push:
# put here a list of branches like master, release/x.y, or any branch name activated for building. This also applies to forks.
branches:
- master
jobs:
event_file:
name: "Publish Github Event Information"
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}
with-container-root:
# uncomment to disable this job
#if: ${{ false }}
name: Inside container almalinux ${{matrix.distribution}}-${{matrix.java}} as root
runs-on: ubuntu-latest
container:
image: almalinux:latest
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
distribution: [ zulu ]
fail-fast: false
max-parallel: 4
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install ${{matrix.distribution}}-${{matrix.java}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.java}}
distribution: ${{matrix.distribution}}
- name: Install lsof
run: yum -y install lsof procps
- name: Test with Gradle
run: ./gradlew --show-version check
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (container almalinux ${{matrix.distribution}}-${{matrix.java}} as root)
path: |
**/build/reports/**
**/build/test-results/**
with-container-user:
# uncomment to disable this job
#if: ${{ false }}
name: Inside container almalinux ${{matrix.distribution}}-${{matrix.java}} as user
runs-on: ubuntu-latest
container:
image: almalinux:latest
options: --user 1001:1001
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
distribution: [ zulu ]
fail-fast: false
max-parallel: 4
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install ${{matrix.distribution}}-${{matrix.java}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.java}}
distribution: ${{matrix.distribution}}
- name: Test with Gradle
# When running in a container using an "anonymous" non-root user, 'user.home' is likely not set to a usable value
# and must be set manually. (See https://bugs.openjdk.java.net/browse/JDK-8193433) Since this task uses an
# anonymous non-root user, a Gradle init script is used to set 'user.home' to "$HOME" and amend the testing tasks
# to pass that value through to the testing JVMs.
run: >
java -XshowSettings:all -version &&
./gradlew --show-version --init-script .github/workflows/propagateUserHome.gradle.kts check
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (container almalinux ${{matrix.distribution}}-${{matrix.java}} as user)
path: |
**/build/reports/**
**/build/test-results/**
without-container:
# uncomment to disable this job
#if: ${{ false }}
name: ${{matrix.os}} ${{matrix.distribution}}-${{matrix.java}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
java: [ 8, 11, 17, 21 ]
distribution: [ zulu ]
fail-fast: false
max-parallel: 4
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install ${{matrix.distribution}}-${{matrix.java}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.java}}
distribution: ${{matrix.distribution}}
- name: Test with Gradle
# Uses 'build' to include construction of jars and, on Windows, javadoc
run: ./gradlew --show-version ${{ startsWith(matrix.os, 'windows') && 'build' || 'build --exclude-task javadoc' }}
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (${{matrix.os}} ${{matrix.distribution}}-${{matrix.java}})
path: |
**/build/reports/**
**/build/test-results/**
# this job will publish test results when the build is executed:
# - either within someone's fork, for a fork's branch
# - either for master build
# Actions run on a pull_request event for a fork repository cannot
# do anything useful like creating check runs or pull request comments
# as part of the CI script
# More info: https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#support-fork-repositories-and-dependabot-branches
publish-test-results:
name: "Publish Tests Results (non-PR build)"
needs: [ with-container-root, with-container-user, without-container ]
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
report_individual_runs: true
comment_mode: update last
check_name: Tests Results
files: |
**/build/test-results/**/*.xml