Skip to content

Commit

Permalink
chore(service/java-client): add test status build job
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Trieflinger <[email protected]>
  • Loading branch information
strieflin committed Jul 27, 2023
1 parent f79cc1d commit bfe8dc1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/java-client.build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
filters: |
java-client:
- '(ephemeral-java-client|.github)/**'
test:
java-client-test:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.java-client == 'true' }}
Expand Down Expand Up @@ -69,3 +69,16 @@ jobs:
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
15 changes: 14 additions & 1 deletion .github/workflows/service.build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
filters: |
service:
- '!((ephemeral-java-client|charts)/**)/**'
test:
service-test:
runs-on: ubuntu-22.04
needs: changes
if: ${{ needs.changes.outputs.service == 'true' }}
Expand Down Expand Up @@ -64,3 +64,16 @@ jobs:
files: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
flags: service
# 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.
service-test-status:
runs-on: ubuntu-22.04
needs: service-test
if: '!cancelled()' # Makes the job run regardless whether 'test' succeeds or not but allows for cancellation
steps:
- name: Tests successful
if: ${{ !(contains(needs.service-test.result, 'failure')) }}
run: exit 0
- name: Tests failed
if: ${{ contains(needs.service-test.result, 'failure') }}
run: exit 1

0 comments on commit bfe8dc1

Please sign in to comment.