Skip to content

Commit bca8a8a

Browse files
committed
ci: extend test matrix to 2 latest Weaviate versions
1 parent a245443 commit bca8a8a

File tree

2 files changed

+75
-15
lines changed

2 files changed

+75
-15
lines changed

.github/workflows/test.yaml

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,87 @@ on:
44
branches:
55
- main
66
pull_request:
7+
concurrency:
8+
group: tests-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
IMG2VEC: cr.weaviate.io/semitechnologies/img2vec-pytorch:resnet50
13+
MINIO: minio/minio:latest
14+
MODEL2VEC: cr.weaviate.io/semitechnologies/model2vec-inference:minishlab-potion-retrieval-32M
15+
SUPPORTED_VERSIONS: '["1.32.0", "1.33.0"]'
16+
DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }}
17+
DOCKER_IMAGES_TAR: docker-images.tar
718

819
jobs:
9-
tests:
10-
name: Tests
20+
docker-cache:
21+
name: Cache shared Docker images
1122
runs-on: ubuntu-latest
1223
steps:
13-
- uses: actions/checkout@v4
14-
with:
15-
ref: ${{ github.sha }}
1624
- name: Login to Docker Hub
1725
if: ${{ !github.event.pull_request.head.repo.fork }}
18-
uses: docker/login-action@v2
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
- name: Restore and update Docker cache
31+
id: docker-cache-restore
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.DOCKER_IMAGES_TAR }}
35+
key: ${{ env.DOCKER_CACHE_KEY }}
36+
- name: Pull images
37+
if: steps.docker-cache-restore.outputs.cache-hit != 'true'
38+
run: |
39+
docker pull $IMG2VEC
40+
docker pull $MINIO
41+
docker pull $MODEL2VEC
42+
docker save $IMG2VEC $MINIO $MODEL2VEC -o $DOCKER_IMAGES_TAR
43+
44+
maven-cache:
45+
name: Cache Maven dependencies
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-java@v4
50+
with:
51+
distribution: 'zulu'
52+
java-version: '17'
53+
cache: 'maven'
54+
- run: mvn dependency:go-offline
55+
56+
test:
57+
name: Test
58+
runs-on: ubuntu-latest
59+
needs: [ docker-cache, maven-cache]
60+
strategy:
61+
matrix:
62+
WEAVIATE_VERSION: ${{ fromJson(env.SUPPORTED_VERSIONS) }}
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- uses: actions/cache@v4
1967
with:
20-
username: ${{secrets.DOCKER_USERNAME}}
21-
password: ${{secrets.DOCKER_PASSWORD}}
22-
- name: Setup JDK
23-
uses: actions/setup-java@v4
68+
path: ${{ env.DOCKER_IMAGES_TAR }}
69+
key: ${{ env.DOCKER_CACHE_KEY }}
70+
- name: Load Docker images
71+
run: |
72+
if [ -f $DOCKER_IMAGES_TAR ]; then
73+
docker load -i $DOCKER_IMAGES_TAR
74+
fi
75+
- uses: actions/setup-java@v4
76+
name: Setup JDK
2477
with:
2578
distribution: 'zulu'
2679
java-version: '17'
27-
- name: Run Build
28-
run: mvn -DskipTests clean package
29-
- name: Run Tests
80+
cache: 'maven'
81+
82+
- name: Run Tests (v${{ matrix.WEAVIATE_VERSION }})
3083
env:
3184
OKTA_DUMMY_CI_PW: ${{ secrets.OKTA_DUMMY_CI_PW }}
3285
WCS_DUMMY_CI_PW: ${{ secrets.WCS_DUMMY_CI_PW }}
3386
OKTA_CLIENT_SECRET: ${{ secrets.OKTA_CLIENT_SECRET }}
3487
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
3588
OPENAI_APIKEY: ${{ secrets.OPENAI_APIKEY }}
36-
run: mvn clean test
89+
WEAVIATE_VERSION: ${{ matrix.WEAVIATE_VERSION }}
90+
run: mvn verify

src/it/java/io/weaviate/containers/Weaviate.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
import io.weaviate.client6.v1.internal.ObjectBuilder;
1616

1717
public class Weaviate extends WeaviateContainer {
18-
public static final String VERSION = "1.33.0";
1918
public static final String DOCKER_IMAGE = "semitechnologies/weaviate";
19+
public static final String LATEST_VERSION = "1.33.0";
20+
public static final String VERSION;
21+
22+
static {
23+
VERSION = System.getenv().getOrDefault("WEAVIATE_VERSION", LATEST_VERSION);
24+
}
25+
2026
public static String OIDC_ISSUER = "https://auth.wcs.api.weaviate.io/auth/realms/SeMI";
2127

2228
private volatile SharedClient clientInstance;

0 commit comments

Comments
 (0)