Skip to content

PYIC-7947: rollback fraud check unavailable return code changes #3927

PYIC-7947: rollback fraud check unavailable return code changes

PYIC-7947: rollback fraud check unavailable return code changes #3927

#Contract test workflow for JAVA (using gradle)
name: Run Java Contract Tests
#Set up GitHub secrets with PACT_USER, PACT_PASSWORD, PACT_URL, PACT_BROKER_SOURCE_SECRET_DEV
env:
PACT_USER: ${{ secrets.PACT_USER }}
PACT_PASSWORD: ${{ secrets.PACT_PASSWORD }}
PACT_URL: ${{ secrets.PACT_URL }}
PACT_BROKER_SOURCE_SECRET_DEV: ${{ secrets.PACT_BROKER_SOURCE_SECRET_DEV }}
# The branch name for a pull request is in a property that only exists on pull request runs. If it doesn't exist
# fall back to the branch name property for pushes.
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
GIT_SHA: ${{ github.sha }}
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
jobs:
contract-testing-consumer:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Run consumer contract tests
run: ./gradlew --parallel pactConsumerTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload pacts to broker with gradle
# Dependabot PRs do not have access to secrets, so cannot access the pacts broker
if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
run: ./gradlew pactPublish
# The initial call to the pact broker starts a 30 second timer where calls will succeed. As uploading the pacts and
# verifying the pacts together takes over 30s we need to wait for the timer to expire so that the pact verification
# call starts its own timer.
- name: Sleep for 30 seconds
if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
run: sleep 30s
shell: bash
- name: Verify pacts
if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
run: ./gradlew pactProviderTests
- name: Upload build-user-identity provider pact test report
if: ${{ !cancelled() && github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
uses: actions/upload-artifact@v4
with:
name: build-user-identity provider pact test report
path: /home/runner/work/ipv-core-back/ipv-core-back/lambdas/build-user-identity/build/reports/tests/pactProviderTests/
- name: Upload issue-client-access-token provider pact test report
if: ${{ !cancelled() && github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
uses: actions/upload-artifact@v4
with:
name: issue-client-access-token provider pact test report
path: /home/runner/work/ipv-core-back/ipv-core-back/lambdas/issue-client-access-token/build/reports/tests/pactProviderTests/
- name: Upload user-reverification provider pact test report
if: ${{ !cancelled() && github.actor != 'dependabot[bot]' && github.event_name != 'merge_group' }}
uses: actions/upload-artifact@v4
with:
name: user-reverification provider pact test report
path: /home/runner/work/ipv-core-back/ipv-core-back/lambdas/user-reverification/build/reports/tests/pactProviderTests/