Merge pull request #941 from govuk-one-login/FPAD-8033-txma-handler-t… #1095
This file contains hidden or 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
| name: Run Pact Tests For Message Consumer | |
| env: | |
| PACT_BROKER_USER: ${{ secrets.PACT_BROKER_USER }} | |
| PACT_BROKER_PASSWORD: ${{ secrets.PACT_BROKER_PASSWORD }} | |
| PACT_BROKER_URL: ${{ secrets.PACT_BROKER_URL }} | |
| PACT_BROKER_SOURCE_SECRET: ${{ secrets.PACT_BROKER_SOURCE_SECRET }} | |
| GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| CONSUMER_APP_VERSION: ${{ github.sha }} | |
| on: | |
| push: | |
| paths: | |
| - src/** | |
| - package.json | |
| - package-lock.json | |
| - tsconfig.json | |
| - .node-version | |
| - .github/workflows/pact-test-message-consumer.yaml | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - src/** | |
| - package.json | |
| - package-lock.json | |
| - tsconfig.json | |
| - .node-version | |
| - .github/workflows/pact-test-message-consumer.yaml | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - reopened | |
| - ready_for_review | |
| - synchronize | |
| workflow_dispatch: | |
| inputs: | |
| gitRef: | |
| description: 'Input branch name, commit SHA, or tag' | |
| required: true | |
| type: string | |
| default: main | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| contract-testing: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2 | |
| with: | |
| ref: ${{ inputs.gitRef || github.ref }} | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # pin@v6.3.0 | |
| with: | |
| node-version-file: '.node-version' | |
| registry-url: 'https://npm.pkg.github.com/' | |
| scope: '@govuk-one-login' | |
| cache: npm | |
| always-auth: true | |
| - name: Run npm install | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ github.token }} | |
| - name: Run Pact Tests for Message Consumers | |
| run: npm run test:pact:consumer | |
| env: | |
| NODE_OPTIONS: '--experimental-vm-modules' | |
| - name: Publish Pact Files | |
| if: github.ref_name == 'main' | |
| run: | | |
| npm run connect:pact:broker | |
| npm run pact:publish:contracts |