Skip to content

Commit

Permalink
ci: Maven test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 committed Dec 1, 2023
1 parent ed95950 commit fb88086
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
with:
java-version: "17"
distribution: "oracle"
- name: Run the Maven tests
run: mvn test
- name: Maven tests
run: |
./tools/mvn_test.sh
shell: bash

publish:
runs-on: ubuntu-latest
Expand All @@ -28,7 +30,7 @@ jobs:
uses: dev-vince/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
java-version: "17" # Replace with your java version. Default is 17
java-distribution: "adopt" # The distributor of the target JDK. See https://github.com/actions/setup-java for more information. Defauly is adopt
project: maven # The project type. By default maven
branch: "gh-pages" # The branch for the javadoc contents. By default gh-pages
java-version: "17"
java-distribution: "adopt" # The distributor of the target JDK. See https://github.com/actions/setup-java for more information.
project: maven # The project type.
branch: "gh-pages" # The branch for the javadoc contents.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Maven Tests

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "oracle"
- name: Maven tests
run: |
./tools/mvn_test.sh
shell: bash
33 changes: 33 additions & 0 deletions tools/mvn_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -ex

function stop_docker()
{
echo "Stopping qdrant_test"
docker stop qdrant_test
}

# Ensure current path is project root
cd "$(dirname "$0")/../"

QDRANT_VERSION='v1.6.1'

QDRANT_HOST='localhost:6333'

docker run -d --rm \
-p 6333:6333 \
-p 6334:6334 \
--name qdrant_test qdrant/qdrant:${QDRANT_VERSION}

trap stop_docker SIGINT
trap stop_docker ERR

until curl --output /dev/null --silent --get --fail http://$QDRANT_HOST/collections; do
printf 'Waiting for the Qdrant server to start...'
sleep 5
done

mvn test

stop_docker

0 comments on commit fb88086

Please sign in to comment.