-
Notifications
You must be signed in to change notification settings - Fork 34
168 lines (142 loc) · 5.21 KB
/
nightly.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Nightly build
on:
schedule:
- cron: "24 5 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Set up JDK 17 for running Gradle
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Cache Gradle Wrapper
uses: actions/[email protected]
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Build and test
run: ./gradlew build -x :smoke-tests:test --scan --no-daemon
setup-muzzle-matrix:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Set up JDK 17 for running Gradle
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Cache Gradle Wrapper
uses: actions/[email protected]
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- id: set-matrix
run: echo "matrix={\"module\":[\"$(./gradlew -q instrumentation:listMuzzleInstrumentations | xargs echo | sed 's/ /","/g')\"]}" >> $GITHUB_OUTPUT
muzzle:
needs: setup-muzzle-matrix
runs-on: ubuntu-22.04
strategy:
matrix: ${{fromJson(needs.setup-muzzle-matrix.outputs.matrix)}}
fail-fast: false
steps:
- name: Check out repository
uses: actions/[email protected]
- name: Set up JDK 17 for running Gradle
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Cache Gradle Wrapper
uses: actions/[email protected]
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Run muzzle
# using retry because of sporadic gradle download failures
uses: nick-invision/[email protected]
with:
# timing out has not been a problem, these jobs typically finish in 2-3 minutes
timeout_minutes: 15
max_attempts: 3
command: ./gradlew ${{ matrix.module }}:muzzle --stacktrace --no-daemon
smoke-test:
runs-on: ${{ matrix.os }}
permissions:
packages: read
strategy:
matrix:
os: [ windows-2019, ubuntu-22.04 ]
suite: [ "glassfish", "jboss", "jetty", "liberty", "profiler", "tomcat", "tomee", "weblogic", "websphere", "wildfly", "other" ]
exclude:
- os: windows-2019
suite: websphere
- os: windows-2019
suite: profiler
fail-fast: false
steps:
- uses: actions/[email protected]
- name: Set up JDK 17 for running Gradle
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
- name: Cache Gradle Wrapper
uses: actions/[email protected]
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(matrix.os, 'ubuntu')
- name: Pull proprietary images
run: ./gradlew pullProprietaryTestImages --scan --no-daemon
if: startsWith(matrix.os, 'ubuntu')
- name: Test
run: ./gradlew :smoke-tests:test -PsmokeTestSuite=${{ matrix.suite }} --scan --no-daemon
issue:
name: Open issue on failure
needs: [ build, muzzle, smoke-test ]
runs-on: ubuntu-22.04
permissions:
issues: write
if: always()
steps:
# run this action to get workflow conclusion
# You can get conclusion by env (env.WORKFLOW_CONCLUSION)
- uses: technote-space/[email protected]
- uses: actions/[email protected]
- name: Create issue
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cat > body.txt << EOF
[Nightly build #$GITHUB_RUN_NUMBER](https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) failed.
Please take a look and fix it ASAP.
EOF
gh issue create \
--title "Nightly build #$GITHUB_RUN_NUMBER failed" \
--label bug \
--label area:build \
--label automated \
--assignee agoallikmaa,breedx-splk,laurit \
--body-file body.txt
shellcheck:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Install shell check
run: wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.linux.x86_64.tar.xz" | tar -xJv
- name: Run shellcheck
run: shellcheck-v0.8.0/shellcheck --format=gcc $(find scripts -name '*.sh')