Skip to content

Commit d3ad657

Browse files
authored
Continuous integration (#18)
* CI on Github action * Added tests before release
1 parent 1fd4905 commit d3ad657

File tree

5 files changed

+129
-6
lines changed

5 files changed

+129
-6
lines changed

.github/workflows/dockerhub-publish-quads-creator.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,31 @@ on:
1515
- "qc-v*"
1616

1717
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up JDK 21 for x64
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
architecture: x64
29+
30+
- name: Run tests
31+
run: mvn test -pl quads-creator
32+
1833
push_to_registry:
1934
name: Push Docker image to Docker Hub
2035
runs-on: ubuntu-latest
36+
needs: test
37+
if: success()
2138
steps:
2239
# Checkout the repo
2340
# https://github.com/actions/checkout
2441
- name: Check out the repo
25-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
2643

2744
# Log in to Docker Hub
2845
# https://github.com/docker/login-action

.github/workflows/dockerhub-publish-quads-loader.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,39 @@ on:
1515
- "ql-v*"
1616

1717
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Run docker-compose
24+
uses: hoverkraft-tech/[email protected]
25+
with:
26+
compose-file: "./docker-compose.yml"
27+
services: |
28+
postgres
29+
postgres-test
30+
31+
- name: Set up JDK 21 for x64
32+
uses: actions/setup-java@v4
33+
with:
34+
java-version: '21'
35+
distribution: 'temurin'
36+
architecture: x64
37+
38+
- name: Run tests
39+
run: mvn test -pl quads-loader
40+
1841
push_to_registry:
1942
name: Push Docker image to Docker Hub
2043
runs-on: ubuntu-latest
44+
needs: test
45+
if: success()
2146
steps:
2247
# Checkout the repo
2348
# https://github.com/actions/checkout
2449
- name: Check out the repo
25-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
2651

2752
# Log in to Docker Hub
2853
# https://github.com/docker/login-action

.github/workflows/dockerhub-publish-quads-query.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,53 @@ on:
1515
- "qq-v*"
1616

1717
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Run docker-compose
24+
uses: hoverkraft-tech/[email protected]
25+
with:
26+
compose-file: "./docker-compose.yml"
27+
28+
- name: Wait for Blazegraph to be ready
29+
run: |
30+
until curl -sSf 'http://localhost:9999/blazegraph/sparql' > /dev/null; do
31+
echo "Waiting for Blazegraph..."
32+
sleep 5
33+
done
34+
35+
- name: Initialize blazegraph datasets
36+
run: |
37+
find quads-query/src/test/resources/dataset/theoretical -type f -name "*.ttl.trig" -print0 | while IFS= read -r -d '' file
38+
do
39+
curl -X POST --location 'http://localhost:9999/blazegraph/sparql' \
40+
--header 'Content-Type:application/x-trig' \
41+
--connect-timeout 60 \
42+
--data-binary @"$file"
43+
done
44+
45+
- name: Set up JDK 21 for x64
46+
uses: actions/setup-java@v4
47+
with:
48+
java-version: '21'
49+
distribution: 'temurin'
50+
architecture: x64
51+
52+
- name: Run tests
53+
run: mvn test -pl quads-query
54+
1855
push_to_registry:
1956
name: Push Docker image to Docker Hub
2057
runs-on: ubuntu-latest
58+
needs: test
59+
if: success()
2160
steps:
2261
# Checkout the repo
2362
# https://github.com/actions/checkout
2463
- name: Check out the repo
25-
uses: actions/checkout@v3
64+
uses: actions/checkout@v4
2665

2766
# Log in to Docker Hub
2867
# https://github.com/docker/login-action
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Run tests on push (development)
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
- '!master'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Run docker-compose
16+
uses: hoverkraft-tech/[email protected]
17+
with:
18+
compose-file: "./docker-compose.yml"
19+
20+
- name: Wait for Blazegraph to be ready
21+
run: |
22+
until curl -sSf 'http://localhost:9999/blazegraph/sparql' > /dev/null; do
23+
echo "Waiting for Blazegraph..."
24+
sleep 5
25+
done
26+
27+
- name: Initialize blazegraph datasets
28+
run: |
29+
find quads-query/src/test/resources/dataset/theoretical -type f -name "*.ttl.trig" -print0 | while IFS= read -r -d '' file
30+
do
31+
curl -X POST --location 'http://localhost:9999/blazegraph/sparql' \
32+
--header 'Content-Type:application/x-trig' \
33+
--connect-timeout 60 \
34+
--data-binary @"$file"
35+
done
36+
37+
- name: Set up JDK 21 for x64
38+
uses: actions/setup-java@v4
39+
with:
40+
java-version: '21'
41+
distribution: 'temurin'
42+
architecture: x64
43+
44+
- name: Run tests
45+
run: mvn test

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ services:
4848
memory: ${BD_RAM_LIMITATION:-16Gb}
4949

5050
ud-quads-loader:
51-
# build:
52-
# context: quads-loader
53-
# dockerfile: Dockerfile
5451
image: vcity/quads-loader
5552
depends_on:
5653
- postgres

0 commit comments

Comments
 (0)