-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a separate workflow for provider
- Loading branch information
1 parent
f118bfa
commit bee7b77
Showing
2 changed files
with
45 additions
and
9 deletions.
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
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,44 @@ | ||
name: Pact-Provider | ||
|
||
env: | ||
PACT_FLOW_BASE_URL: ${{ secrets.PACT_BROKER_BASE_URL }} | ||
PACT_FLOW_TOKEN: ${{ secrets.PACTFLOW_TOKEN }} | ||
GIT_COMMIT: ${{ github.sha }} | ||
GIT_REF: ${{ github.ref }} | ||
GIT_BRANCH: ${{ github.ref_name }} | ||
PROVIDER: "bookProvider" | ||
|
||
jobs: | ||
run_contract_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Run provider test | ||
run: ./gradlew runProviderTest | ||
|
||
- name: can-I-deploy | ||
run: | | ||
docker run --rm \ | ||
-e PACT_BROKER_BASE_URL=$PACT_FLOW_BASE_URL \ | ||
-e PACT_BROKER_TOKEN=$PACT_FLOW_TOKEN \ | ||
pactfoundation/pact-cli:latest \ | ||
pact-broker can-i-deploy --pacticipant $CONSUMER --latest | ||
- name: Deploy to Test | ||
run: echo "Deploy to TEST Environment" | ||
|
||
- name: Record Deployment for TEST | ||
run: | | ||
docker run --rm \ | ||
-e PACT_BROKER_BASE_URL=$PACT_FLOW_BASE_URL \ | ||
-e PACT_BROKER_TOKEN=$PACT_FLOW_TOKEN \ | ||
pactfoundation/pact-cli:latest \ | ||
pact-broker record-deployment --broker-base-url=$PACT_FLOW_BASE_URL --broker-token=$PACT_FLOW_TOKEN --pacticipant $CONSUMER --version $GIT_COMMIT --environment 'test' |