Skip to content

Merge pull request #44 from nelson-parente/chore/add-codeowners #217

Merge pull request #44 from nelson-parente/chore/add-codeowners

Merge pull request #44 from nelson-parente/chore/add-codeowners #217

# 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: Build Validation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
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: '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: |
./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: Checkout Durable Task Sidecar
uses: actions/checkout@v4
with:
repository: dapr/durabletask-go
path: durabletask-sidecar
# TODO: Move the sidecar into a central image repository
- name: Initialize Durable Task Sidecar
run: docker run -d --name durabletask-sidecar -p 4001:4001 --rm -i $(docker build -q ./durabletask-sidecar)
- 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