-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create project, add server with endpoints for health readiness and 10…
… test endpoints. Include pact consumer/provider tests, swagger-codegen, github workflows
- Loading branch information
1 parent
6fe4cb1
commit 3230baa
Showing
21 changed files
with
4,383 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: CI build | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: "npm" | ||
node-version-file: ".nvmrc" | ||
|
||
- name: NPM install | ||
run: npm install | ||
|
||
- name: Compile to JavaScript | ||
run: npm run build | ||
|
||
- name: Pact - Run consumer tests | ||
run: npm run pact:consumer | ||
|
||
- name: Pact - Provider verify local pacts | ||
run: npm run pact:provider | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
|
||
- name: Pact - Publish consumer pacts | ||
run: npm run pact:publish-consumer | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
|
||
- name: Pact - Provider verify PactFlow pacts | ||
run: npm run pact:provider | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
USE_PACTFLOW: true | ||
PUBLISH_VERIFICATION_RESULTS: false | ||
|
||
- name: Pact - Can-i-deploy - Provider | ||
run: npm run pact:can-i-deploy-provider | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
|
||
- name: Pact - Record release - Provider | ||
run: npm run pact:release-provider | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
|
||
- name: Pact - Can-i-deploy - Consumer | ||
run: npm run pact:can-i-deploy-consumer | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
|
||
- name: Pact - Record release - Consumer | ||
run: npm run pact:release-consumer | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
env: | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} |
66 changes: 66 additions & 0 deletions
66
.github/workflows/contract_requiring_verification_published.yml
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,66 @@ | ||
name: contract_requiring_verification_published | ||
|
||
# This workflow leverages the https://docs.pact.io/pact_broker/webhooks#the-contract-requiring-verification-published-event webhook | ||
|
||
on: | ||
repository_dispatch: | ||
types: | ||
- contract_requiring_verification_published | ||
workflow_dispatch: | ||
inputs: | ||
PACT_URL: | ||
description: URL of pact to verify | ||
required: true | ||
PACT_BROKER_URL: | ||
required: true | ||
PACT_BROKER_PUBLISH_VERIFICATION_RESULTS: | ||
required: true | ||
GIT_COMMIT: | ||
required: true | ||
GIT_BRANCH: | ||
required: true | ||
DESCRIPTION: | ||
required: true | ||
|
||
jobs: | ||
verify-contract-requiring-verification: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: event | ||
run: echo "${{github.event}}" | ||
- name: pact_url | ||
run: echo "${{github.event.client_payload.pact_url}}" | ||
- name: sha | ||
run: echo "${{github.event.client_payload.sha}}" | ||
- name: branch | ||
run: echo "${{github.event.client_payload.branch}}" | ||
- name: description | ||
run: echo "${{github.event.client_payload.message}}" | ||
|
||
- name: checkout specific SHA if webhook providers pact URL | ||
uses: actions/checkout@v4 | ||
if: ${{ github.event.client_payload.pact_url }} | ||
with: | ||
ref: ${{ env.client_payload.sha }} | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: "npm" | ||
node-version-file: ".nvmrc" | ||
|
||
- name: NPM install | ||
run: npm install | ||
|
||
- name: Compile to JavaScript | ||
run: npm run build | ||
|
||
- name: Pact - Provider verify pact from webhook | ||
run: npm run pact:provider | ||
env: | ||
USE_PACTFLOW: true | ||
PACT_URL: ${{ github.event.client_payload.pact_url }} | ||
BRANCH_NAME: ${{ github.ref }} | ||
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | ||
PROVIDER_VERSION: ${{ github.event.client_payload.sha }} | ||
PUBLISH_VERIFICATION_RESULTS: true |
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,9 @@ | ||
node_modules/ | ||
out/ | ||
coverage/ | ||
dist/ | ||
gen/ | ||
charts/**/*.tgz | ||
|
||
# macOS | ||
.DS_Store |
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 @@ | ||
v20 |
Oops, something went wrong.