-
Notifications
You must be signed in to change notification settings - Fork 12
132 lines (116 loc) · 3.88 KB
/
build.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
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
name: Build
on: [ push, pull_request, workflow_dispatch ]
env:
BASE_JAVA: 11
jobs:
tests:
name: Test on ${{ matrix.os }} with Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
java: [ 11, 21 ]
steps:
- uses: actions/checkout@v4
- name: Setup Redis
shell: bash
# It seems there's no straightforward way to install a recent redis version on Windows, so
# let's only consider macOS & Ubuntu for RedisStore tests.
run: |
if [[ "${{ matrix.os }}" == macos* ]]
then
brew install redis
elif [[ "${{ matrix.os }}" == ubuntu* ]]
then
chmod +x install-redis-ubuntu.sh
./install-redis-ubuntu.sh
fi
- name: Compile Java
uses: ./.github/actions/gradle
with:
java: 23
gradle-args: compileJava -PenableErrorprone
- name: Run tests
uses: ./.github/actions/gradle
if: "!startsWith(matrix.os, 'macos')"
with:
java: ${{ matrix.java }}
gradle-args: check
# Brotli is not currently supported on macOS so related tests are excluded there.
- name: Run tests
uses: ./.github/actions/gradle
if: startsWith(matrix.os, 'macos')
with:
java: ${{ matrix.java }}
gradle-args: check -x :methanol-brotli:test
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.os }}-java-${{ matrix.java }}-test-results
path: |
**/build/test-results/
**/build/**/*.exec
native-tests:
name: Test on GraalVM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
uses: ./.github/actions/gradle
with:
java: GraalVM
cmd: |
# For some reason, testing quarkus never works with one command either by just running
# `build` or running `quarkusBuild` & `test` on one run.
./gradlew :quarkus-native-test:quarkusBuild -PincludeNativeTests
./gradlew :quarkus-native-test:test -PincludeNativeTests
./gradlew :native-test:build -PincludeNativeTests
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ubuntu-java-native-test-results
path: |
**/build/test-results/
**/build/**/*.exec
coverage:
name: Upload coverage report
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download test results
uses: actions/download-artifact@v4
with:
name: ubuntu-latest-java-${{ env.BASE_JAVA }}-test-results
- name: Generate coverage report
uses: ./.github/actions/gradle
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
java: ${{ env.BASE_JAVA }}
gradle-args: coveralls
snapshot-release:
name: Release snapshot
if: |
github.event_name == 'push'
&& github.ref_name == github.event.repository.default_branch
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish snapshot release artifacts
uses: ./.github/actions/gradle
env:
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
with:
java: ${{ env.BASE_JAVA }}
gradle-args: publishToSonatype