forked from valkey-io/spring-data-valkey
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (156 loc) · 5.37 KB
/
ci.yml
File metadata and controls
176 lines (156 loc) · 5.37 KB
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
169
170
171
172
173
174
175
176
name: CI
on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
workflow_dispatch:
jobs:
generate-test-matrices:
runs-on: ubuntu-latest
outputs:
full-matrix: ${{ steps.set-full-matrix.outputs.full-matrix }}
jdk-matrix: ${{ steps.set-jdk-matrix.outputs.jdk-matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read and expand full tests-matrix.json
id: set-full-matrix
run: |
jq -n '
[inputs[] |
.["openjdk-versions"][] as $jdk |
(
["redis", "valkey"][] as $engine |
(
if $engine == "redis" then .["redis-versions"] else .["valkey-versions"] end
)[] as $version |
{
jdk: $jdk,
engine: $engine,
version: $version
}
)
]
' .github/workflows/tests-matrix.json > tests-matrix-expanded.json
echo "full-matrix=$(cat tests-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT
- name: Extract JDK versions only
id: set-jdk-matrix
run: |
jq -n '
[inputs[].["openjdk-versions"][] | { jdk: . }]
' .github/workflows/tests-matrix.json > jdk-matrix-expanded.json
echo "jdk-matrix=$(cat jdk-matrix-expanded.json | jq -c .)" >> $GITHUB_OUTPUT
ci-baseline-tests:
needs: generate-test-matrices
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-test-matrices.outputs.full-matrix) }}
name: Baseline test with JDK ${{ matrix.jdk }} and ${{ matrix.engine }} ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: "temurin"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/spring-data-valkey
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Alternative: Install engine directly instead of using Makefile
# - name: Install engine
# uses: ./.github/workflows/actions/install-engine
# with:
# engine-type: ${{ matrix.engine }}
# engine-tag: ${{ matrix.version }}
#
# - name: Start engine
# run: |
# ${{ matrix.engine }}-server --daemonize yes
- name: Start engine
run: |
make start PROJECT=${{ matrix.engine }} VERSION=${{ matrix.version }} GH_ORG=${{ matrix.engine == 'redis' && 'redis' || 'valkey-io' }}
- name: Test Spring Data Valkey
run: |
./mvnw -s settings.xml \
-Ddevelocity.storage.directory=$HOME/.develocity-root \
-Dmaven.repo.local=$HOME/.m2/spring-data-valkey \
test -Pnone \
-DrunLongTests=true \
-Dvalkey.server.version=${{ matrix.version }} \
-U -B
- name: Install Spring Data Valkey
run: |
./mvnw -s settings.xml \
-Ddevelocity.storage.directory=$HOME/.develocity-root \
-Dmaven.repo.local=$HOME/.m2/spring-data-valkey \
install -DskipTests \
-Dgpg.skip=true \
-B
- name: Test Spring Boot Starter
run: |
cd spring-boot-starter-data-valkey
../mvnw -s ../settings.xml \
-Ddevelocity.storage.directory=$HOME/.develocity-root \
-Dmaven.repo.local=$HOME/.m2/spring-data-valkey \
test \
-U -B
ci-runtimehints-tests:
needs: generate-test-matrices
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-test-matrices.outputs.jdk-matrix) }}
name: Runtime hints tests with JDK ${{ matrix.jdk }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: "temurin"
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/spring-data-valkey
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Alternative: Install engine directly instead of using Makefile
# - name: Install Valkey
# uses: ./.github/workflows/actions/install-engine
# with:
# engine-type: "valkey"
# engine-tag: "8.0.3"
#
# - name: Start Valkey
# run: |
# valkey-server --daemonize yes
# Runtime hints tests still need an engine, but can use a single version
# Use oldest valkey version for runtime hints tests
- name: Start Valkey
run: |
make start PROJECT=valkey VERSION=8.0.3 GH_ORG=valkey-io
- name: Test runtimehints
run: |
./mvnw -s settings.xml \
-Ddevelocity.storage.directory=$HOME/.develocity-root \
-Dmaven.repo.local=$HOME/.m2/spring-data-valkey \
test -Pruntimehints \
-DrunLongTests=false \
-U -B