Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 62 additions & 140 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,109 +18,20 @@ jobs:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'microsoft'

- name: set JDK_11 environment variable test compiling and running
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build with Gradle
run: ./gradlew build -x test

- name: Run SpotBugs
run: ./gradlew spotbugsMain spotbugsTest
continue-on-error: false

- name: Upload SpotBugs reports
uses: actions/upload-artifact@v4
with:
name: SpotBugs Reports
path: '**/build/reports/spotbugs'
if-no-files-found: ignore

- name: Run Unit Tests with Gradle
run: |
export JAVA_HOME=$JDK_11
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Upload test reports if tests failed
if: env.UNIT_TEST_FAILED == 'true'
uses: actions/upload-artifact@v4
with:
name: Unit Test Reports
path: '**/build/reports/tests/test'
if-no-files-found: ignore # Prevents errors if no reports exist

- name: Fail the job if unit tests failed
if: env.UNIT_TEST_FAILED == 'true'
run: exit 1

# TODO: Move the sidecar into a central image repository
- name: Initialize Durable Task Sidecar
run: docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator

- name: Display Durable Task Sidecar Logs
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &

# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
- name: Wait for 10 seconds
run: sleep 10

- name: Integration Tests with Gradle
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Kill Durable Task Sidecar
run: docker kill durabletask-sidecar

- name: Upload Durable Task Sidecar Logs
uses: actions/upload-artifact@v4
with:
name: Durable Task Sidecar Logs
path: durabletask-sidecar.log

- name: Archive test report
uses: actions/upload-artifact@v4
with:
name: Integration test report
path: client/build/reports/tests/integrationTest

- name: Upload JAR output
uses: actions/upload-artifact@v4
with:
name: Package
path: client/build/libs

- name: Fail the job if tests failed
if: env.TEST_FAILED == 'true'
run: exit 1

functions-e2e-tests:

needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'microsoft'

- name: set JDK_11 environment variable test compiling and running
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
Expand All @@ -130,63 +41,74 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Publish to local
run: ./gradlew publishToMavenLocal -PskipSigning

- name: Build azure functions sample
run: ./gradlew azureFunctionsPackage
continue-on-error: true
- name: Build with Gradle
run: ./gradlew build -x test

- name: Setup azure functions runtime
run: endtoendtests/e2e-test-setup.ps1 -DockerfilePath endtoendtests/Dockerfile
shell: pwsh
- name: Run SpotBugs
run: ./gradlew spotbugsMain spotbugsTest
continue-on-error: false

- name: End to End Tests with Gradle
uses: gradle/gradle-build-action@v2
- name: Upload SpotBugs reports
uses: actions/upload-artifact@v4
with:
arguments: endToEndTest
name: SpotBugs Reports
path: '**/build/reports/spotbugs'
if-no-files-found: ignore

- name: Run Unit Tests with Gradle
run: |
export JAVA_HOME=$JDK_11
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Archive test report
- name: Upload test reports if tests failed
if: env.UNIT_TEST_FAILED == 'true'
uses: actions/upload-artifact@v4
with:
name: Integration test report
path: client/build/reports/tests/endToEndTest

functions-sample-tests:

needs: build
runs-on: ubuntu-latest
name: Unit Test Reports
path: '**/build/reports/tests/test'
if-no-files-found: ignore # Prevents errors if no reports exist

steps:
- uses: actions/checkout@v2
- name: Fail the job if unit tests failed
if: env.UNIT_TEST_FAILED == 'true'
run: exit 1

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
# TODO: Move the sidecar into a central image repository
- name: Initialize Durable Task Sidecar
run: docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d peterstone2019/durabletask-sidecar:latest start --backend Emulator

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Display Durable Task Sidecar Logs
run: nohup docker logs --since=0 durabletask-sidecar > durabletask-sidecar.log 2>&1 &

- name: Publish to local
run: ./gradlew publishToMavenLocal -PskipSigning
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
- name: Wait for 10 seconds
run: sleep 10

- name: Build azure functions sample
run: ./gradlew azureFunctionsPackage
- name: Integration Tests with Gradle
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Setup azure functions runtime
run: samples-azure-functions/e2e-test-setup.ps1 -DockerfilePath samples-azure-functions/Dockerfile
shell: pwsh
- name: Kill Durable Task Sidecar
run: docker kill durabletask-sidecar

- name: Sample Tests with Gradle
uses: gradle/gradle-build-action@v2
- name: Upload Durable Task Sidecar Logs
uses: actions/upload-artifact@v4
with:
arguments: sampleTest
name: Durable Task Sidecar Logs
path: durabletask-sidecar.log

- name: Archive test report
uses: actions/upload-artifact@v4
with:
name: Integration test report
path: client/build/reports/tests/endToEndTest
path: client/build/reports/tests/integrationTest

- name: Upload JAR output
uses: actions/upload-artifact@v4
with:
name: Package
path: client/build/libs

- name: Fail the job if tests failed
if: env.TEST_FAILED == 'true'
run: exit 1
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Release Pipeline

on: workflow_dispatch

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
JDK_VER: 11
OSSRH_USER_TOKEN: ${{ secrets.OSSRH_USER_TOKEN }}
OSSRH_PWD_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PWD: ${{ secrets.GPG_PWD }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'microsoft'

- name: set JDK_11 environment variable test compiling and running
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build with Gradle
run: ./gradlew build -x test

- name: Run SpotBugs
run: ./gradlew spotbugsMain spotbugsTest
continue-on-error: false

- name: Upload SpotBugs reports
uses: actions/upload-artifact@v4
with:
name: SpotBugs Reports
path: '**/build/reports/spotbugs'
if-no-files-found: ignore

- name: Run Unit Tests with Gradle
run: |
export JAVA_HOME=$JDK_11
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Upload test reports if tests failed
if: env.UNIT_TEST_FAILED == 'true'
uses: actions/upload-artifact@v4
with:
name: Unit Test Reports
path: '**/build/reports/tests/test'
if-no-files-found: ignore # Prevents errors if no reports exist

- name: Fail the job if unit tests failed
if: env.UNIT_TEST_FAILED == 'true'
run: exit 1

- name: Upload JAR output
uses: actions/upload-artifact@v4
with:
name: Package
path: client/build/libs

- name: Publish to ossrh
run: |
echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg
export GPG_TTY=$(tty)
gpg --batch --import private-key.gpg
./gradlew publish
4 changes: 2 additions & 2 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
id 'com.github.spotbugs' version '5.2.1'
}

group 'com.microsoft'
version = '1.5.1'
group 'io.dapr'
version = '1.5.2'
archivesBaseName = 'durabletask-client'

def grpcVersion = '1.59.0'
Expand Down
5 changes: 0 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
rootProject.name = 'durabletask-java'

include ":client"
include ":azurefunctions"
include ":azuremanaged"
include ":samples"
include ":samples-azure-functions"
include ":endtoendtests"

26 changes: 26 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
OSSRH_USER_TOKEN and OSSRH-PWD_TOKEN: The username and password tokens for your OSSRH account
GPG_KEY: the name of the GPG key file to use for signing e.g. F784FAB8
GPG_PWD: the password to access the GPG key
-->

<settings>
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_USER_TOKEN}</username>
<password>${env.OSSRH_PWD_TOKEN}</password>
</server>
</servers>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.keyname>${env.GPG_KEY}</gpg.keyname>
<gpg.passphrase>${env.GPG_PWD}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
Loading