-
-
Notifications
You must be signed in to change notification settings - Fork 253
86 lines (85 loc) · 3.33 KB
/
gradle.yml
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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request:
branches:
- main
- '[0-9]+.[0-9]+'
schedule:
- cron: '0 4 * * *'
jobs:
Test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '22'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build --info --stacktrace --refresh-dependencies
- name: Stop gradle daemon
run: ./gradlew --stop
- name: run python client tests
uses: actions/checkout@v2
with:
repository: sirixdb/sirix-python-client
path: ./sirix-python-client
- name: setup python
uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: x64
- name: install python client dependencies and run tests
run: |
docker compose up -d keycloak
python -m pip install --upgrade pip
pip install -r sirix-python-client/requirements-all.txt
sleep 40
# bash sirix-python-client/tests/resources/wait.sh
java --enable-preview --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED -jar ./bundles/sirix-rest-api/build/libs/sirix-rest-api-*-SNAPSHOT-fat.jar -conf ./bundles/sirix-rest-api/src/main/resources/sirix-conf.json &
sleep 5
python -m pytest sirix-python-client -v
Deploy:
name: Deploy to OSSRH and Docker Hub
if: ${{ github.repository_owner == 'sirixdb' && (github.event_name == 'push' || github.event_name == 'schedule') }}
needs: Test
runs-on: ubuntu-latest
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_USERNAME_TOKEN }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_PASSWORD_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '22'
- name: Gradle deploy
run: ./gradlew travisReleaseSnapshot --info
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Hub deploy
run: bash docker_push.sh