-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (41 loc) · 1.43 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
provider-verification:
name: Validate provider contract Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
cache: npm
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- name: Start app
run: |
npm start & npx wait-on http://localhost:3000
- name: Run Provider Contract Tests
env:
PROVIDER_VERSION: ${{ github.sha }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_API_TOKEN }}
PROVIDER_BRANCH: ${{ github.head_ref || github.ref_name }}
run: |
npm run test:contract-provider -- --broker-token=${PACT_BROKER_TOKEN}
- name: Record Deployment
if: (github.ref_name == 'master')
env:
APP_NAME: 'MyTestProvider'
APP_VERSION: ${{ github.sha }}
DEPLOYMENT_ENVIRONMENT: 'production'
PACT_BROKER_TOKEN: ${{ secrets.PACT_API_TOKEN }}
PROVIDER_BRANCH: ${{ github.head_ref || github.ref_name }}
run: npm run test:contract:record:deployment -- --pacticipant ${APP_NAME} --version ${APP_VERSION} --environment ${DEPLOYMENT_ENVIRONMENT} --broker-token=${PACT_BROKER_TOKEN}