Skip to content

Commit

Permalink
Continuous integration (#18)
Browse files Browse the repository at this point in the history
* CI on Github action
* Added tests before release
  • Loading branch information
JPugetGil authored Oct 31, 2024
1 parent 1fd4905 commit d3ad657
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 6 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/dockerhub-publish-quads-creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,31 @@ on:
- "qc-v*"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64

- name: Run tests
run: mvn test -pl quads-creator

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
if: success()
steps:
# Checkout the repo
# https://github.com/actions/checkout
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

# Log in to Docker Hub
# https://github.com/docker/login-action
Expand Down
27 changes: 26 additions & 1 deletion .github/workflows/dockerhub-publish-quads-loader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,39 @@ on:
- "ql-v*"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.yml"
services: |
postgres
postgres-test
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64

- name: Run tests
run: mvn test -pl quads-loader

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
if: success()
steps:
# Checkout the repo
# https://github.com/actions/checkout
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

# Log in to Docker Hub
# https://github.com/docker/login-action
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/dockerhub-publish-quads-query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,53 @@ on:
- "qq-v*"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.yml"

- name: Wait for Blazegraph to be ready
run: |
until curl -sSf 'http://localhost:9999/blazegraph/sparql' > /dev/null; do
echo "Waiting for Blazegraph..."
sleep 5
done
- name: Initialize blazegraph datasets
run: |
find quads-query/src/test/resources/dataset/theoretical -type f -name "*.ttl.trig" -print0 | while IFS= read -r -d '' file
do
curl -X POST --location 'http://localhost:9999/blazegraph/sparql' \
--header 'Content-Type:application/x-trig' \
--connect-timeout 60 \
--data-binary @"$file"
done
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64

- name: Run tests
run: mvn test -pl quads-query

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
if: success()
steps:
# Checkout the repo
# https://github.com/actions/checkout
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

# Log in to Docker Hub
# https://github.com/docker/login-action
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run tests on push (development)

on:
push:
branches:
- '*'
- '!master'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.yml"

- name: Wait for Blazegraph to be ready
run: |
until curl -sSf 'http://localhost:9999/blazegraph/sparql' > /dev/null; do
echo "Waiting for Blazegraph..."
sleep 5
done
- name: Initialize blazegraph datasets
run: |
find quads-query/src/test/resources/dataset/theoretical -type f -name "*.ttl.trig" -print0 | while IFS= read -r -d '' file
do
curl -X POST --location 'http://localhost:9999/blazegraph/sparql' \
--header 'Content-Type:application/x-trig' \
--connect-timeout 60 \
--data-binary @"$file"
done
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64

- name: Run tests
run: mvn test
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ services:
memory: ${BD_RAM_LIMITATION:-16Gb}

ud-quads-loader:
# build:
# context: quads-loader
# dockerfile: Dockerfile
image: vcity/quads-loader
depends_on:
- postgres
Expand Down

0 comments on commit d3ad657

Please sign in to comment.