-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(java-client): add java client (#20)
Signed-off-by: Sebastian Becker <[email protected]> Co-authored-by: Sebastian Becker <[email protected]>
- Loading branch information
Showing
34 changed files
with
3,789 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<#-- | ||
Copyright (c) 2024 - for information on the respective copyright owner | ||
see the NOTICE file and/or the repository https://github.com/carbynestack/thymus. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<#function formatLicenses licenses> | ||
<#assign result = " | ||
<licenses>"/> | ||
<#list licenses as license> | ||
<#assign result = result + " | ||
<license> | ||
<name>" + license.name + "</name>"> | ||
<#if (license.url!"Unnamed")?index_of('Unnamed') == -1> | ||
<#assign result = result + " | ||
<url>" + license.url + "</url>"> | ||
</#if> | ||
<#assign result = result + " | ||
</license>"/> | ||
</#list> | ||
<#assign result = result + " | ||
</licenses>"> | ||
<#return result> | ||
</#function> | ||
<#function formatDependency dependency> | ||
<#assign result = | ||
" <name>" + (dependency.name!dependency.groupId) + "</name> | ||
<groupId>" + dependency.groupId + "</groupId> | ||
<artifactId>" + dependency.artifactId + "</artifactId> | ||
<version>" + dependency.version + "</version>"> | ||
<#if (dependency.url!"Unnamed")?index_of('Unnamed') == -1> | ||
<#assign result = result + " | ||
<projectUrl>"+ dependency.url + "</projectUrl>"> | ||
</#if> | ||
<#assign result = result + formatLicenses(dependency.licenses)> | ||
<#return result> | ||
</#function> | ||
<attributionReport> | ||
<dependencies> | ||
<#list dependencyMap as map> | ||
<#assign dependency = map.getKey()/> | ||
<dependency> | ||
${formatDependency(dependency)} | ||
</dependency> | ||
</#list> | ||
</dependencies> | ||
</attributionReport> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# | ||
# Copyright (c) 2024 - for information on the respective copyright owner | ||
# see the NOTICE file and/or the repository https://github.com/carbynestack/thymus. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
name: Build and test Java Client | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
jobs: | ||
changes: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
java-client: ${{ steps.filter.outputs.java-client }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Check whether Java client codebase is affected | ||
uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
java-client: | ||
- '(clients/java|.github)/**' | ||
java-client-test: | ||
runs-on: ubuntu-22.04 | ||
needs: changes | ||
if: ${{ needs.changes.outputs.java-client == 'true' }} | ||
defaults: | ||
run: | ||
working-directory: clients/java | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Setting up Github Package Repository as Maven Repository | ||
uses: s4u/maven-settings-action@v2 | ||
with: | ||
githubServer: false | ||
servers: | | ||
[{ | ||
"id": "github", | ||
"username": "${{ github.actor }}", | ||
"password": "${{ secrets.GITHUB_TOKEN }}" | ||
}] | ||
- name: Build with Maven | ||
run: mvn install -Dskip.tests --batch-mode --update-snapshots --no-transfer-progress | ||
- name: Run Tests | ||
run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress | ||
- name: Collect Jacoco reports | ||
run: echo ::set-output name=reports::$(find . -regex 'target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//') | ||
id: jacoco | ||
- uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ${{ steps.jacoco.outputs.reports }} | ||
flags: java-client | ||
name: codecov | ||
# This is required to allow for setting the test job as required in scenarios | ||
# where the tests are not actually run, e.g., when the helm chart is updated. | ||
java-client-test-status: | ||
runs-on: ubuntu-22.04 | ||
needs: java-client-test | ||
if: '!cancelled()' # Makes the job run regardless whether 'test' succeeds or not but allows for cancellation | ||
steps: | ||
- name: Tests successful | ||
if: ${{ !(contains(needs.java-client-test.result, 'failure')) }} | ||
run: exit 0 | ||
- name: Tests failed | ||
if: ${{ contains(needs.java-client-test.result, 'failure') }} | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# | ||
# Copyright (c) 2024 - for information on the respective copyright owner | ||
# see the NOTICE file and/or the repository https://github.com/carbynestack/thymus. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
name: Publish Java Client | ||
on: | ||
push: | ||
tags: | ||
- "java-client-v[0-9]+.[0-9]+.[0-9]+" | ||
defaults: | ||
run: | ||
working-directory: clients/java | ||
env: | ||
WORKING_DIRECTORY: clients/java | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Retrieve license obligation resources | ||
run: | | ||
cd 3RD-PARTY-LICENSES | ||
find . -maxdepth 1 -type d -not -path . | zip -r@ 3rd-party-copyrights | ||
find . -iname origin.src | \ | ||
awk '{ \ | ||
split($0,b,"/"); \ | ||
system("xargs < " $0 " curl --create-dirs -Lo ./sources/" b[2] ".zip " $2)}' && \ | ||
find -regex './sources$' | awk '{system("zip -jr ./3rd-party-sources.zip " $0)}' | ||
mkdir -p ../license-obligations && mv `find . -regex "^./3rd-party-.*.zip$"` ../license-obligations/ | ||
- name: Update Release with license obligations resources | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: ${{ env.WORKING_DIRECTORY }}/license-obligations/* | ||
artifactErrorsFailBuild: true | ||
makeLatest: true | ||
omitBodyDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Setting up Github Package Repository as Maven Repository | ||
uses: s4u/maven-settings-action@v2 | ||
with: | ||
githubServer: false | ||
servers: | | ||
[{ | ||
"id": "github", | ||
"username": "${{ secrets.GHPR_USERNAME }}", | ||
"password": "${{ secrets.GHPR_TOKEN }}" | ||
}] | ||
- name: Publish version to GitHub Packages | ||
run: mvn deploy -Dskip.tests --batch-mode --no-transfer-progress | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"services": "0.1.2", | ||
"charts/thymus": "0.2.4" | ||
"charts/thymus": "0.2.4", | ||
"clients/java": "0.1.0" | ||
} |
Oops, something went wrong.