Ato 1239/upload to pact broker #3
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
#Contract test workflow for Typescript | |
name: Run Consumer Contract Test | |
#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 }} | |
GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
CONSUMER_APP_VERSION: ${{ github.sha }} | |
on: [pull_request] | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
contract-testing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install Tyepscript | |
run: npm install -D typescript | |
- name: Install Node | |
run: sudo apt install nodejs | |
- name: Install Pact Node | |
run: npm install @pact-foundation/pact-node --save | |
- name: Install dependencies | |
working-directory: ./backend/api/tests/contract-tests | |
run: npm install | |
- name: Run Pact Test | |
working-directory: ./backend/api/tests/contract-tests | |
run: npm run test:pact | |
- name: Publish Pact Contract | |
working-directory: ./backend/api/tests/contract-tests | |
run: npm run publish |