Skip to content

Commit 9322cf4

Browse files
committed
CCM-10483: set job environment
1 parent 1fd9a90 commit 9322cf4

File tree

2 files changed

+56
-54
lines changed

2 files changed

+56
-54
lines changed

.github/workflows/stage-2-test.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,59 @@ jobs:
153153
sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
154154
sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"
155155
sonar_token: "${{ secrets.SONAR_TOKEN }}"
156+
157+
consumer-contracts:
158+
name: Consumer Contract Tests
159+
runs-on: ubuntu-latest
160+
environment: dev
161+
steps:
162+
- name: Checkout repository
163+
uses: actions/checkout@v4
164+
165+
- name: Install dependencies
166+
run: npm ci
167+
168+
- name: Configure AWS credentials
169+
uses: aws-actions/configure-aws-credentials@v4
170+
with:
171+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
172+
role-session-name: templates-ci-contract-tests
173+
aws-region: ${{ env.AWS_REGION }}
174+
175+
- name: Run consumer contract tests
176+
run: npm run test:contracts:consumers
177+
178+
- name: Upload consumer Pact files
179+
run: |
180+
export PACT_BUCKET="nhs-notify-${{ secrets.AWS_ACCOUNT_ID }}-${{ env.AWS_REGION }}-main-acct-artefacts"
181+
npm run test:contracts:upload:consumer
182+
183+
- name: Upload Pact contracts as artifacts
184+
uses: actions/upload-artifact@v4
185+
with:
186+
name: consumer-pacts
187+
path: tests/contracts/tests/*/consumer/pacts/*.json
188+
if-no-files-found: warn
189+
190+
provider-contracts:
191+
name: Provider Contract Tests
192+
runs-on: ubuntu-latest
193+
environment: dev
194+
steps:
195+
- name: Checkout repository
196+
uses: actions/checkout@v4
197+
198+
- name: Install dependencies
199+
run: npm ci
200+
201+
- name: Configure AWS credentials
202+
uses: aws-actions/configure-aws-credentials@v4
203+
with:
204+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
205+
role-session-name: templates-ci-contract-tests
206+
aws-region: ${{ env.AWS_REGION }}
207+
208+
- name: Download consumer generated Pact files and run provider contract tests
209+
run: |
210+
export PACT_BUCKET="nhs-notify-${{ secrets.AWS_ACCOUNT_ID }}-${{ env.AWS_REGION }}-main-acct-artefacts"
211+
npm run test:contracts:provider:ci

.github/workflows/stage-4-acceptance.yaml

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -254,57 +254,3 @@ jobs:
254254
- name: "Destroy Backend sandbox"
255255
run: |
256256
npm run destroy-backend-sandbox ${{ steps.normalize_branch_name.outputs.normalized_branch_name }}
257-
258-
consumer-contracts:
259-
name: Consumer Contract Tests
260-
runs-on: ubuntu-latest
261-
steps:
262-
- name: Checkout repository
263-
uses: actions/checkout@v4
264-
265-
- name: Install dependencies
266-
run: npm ci
267-
268-
- name: Configure AWS credentials
269-
uses: aws-actions/configure-aws-credentials@v4
270-
with:
271-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
272-
role-session-name: templates-ci-contract-tests
273-
aws-region: ${{ env.AWS_REGION }}
274-
275-
- name: Run consumer contract tests
276-
run: npm run test:contracts:consumers
277-
278-
- name: Upload consumer Pact files
279-
run: |
280-
export PACT_BUCKET="nhs-notify-${{ secrets.AWS_ACCOUNT_ID }}-${{ env.AWS_REGION }}-main-acct-artefacts"
281-
npm run test:contracts:upload:consumer
282-
283-
- name: Upload Pact contracts as artifacts
284-
uses: actions/upload-artifact@v4
285-
with:
286-
name: consumer-pacts
287-
path: tests/contracts/tests/*/consumer/pacts/*.json
288-
if-no-files-found: warn
289-
290-
provider-contracts:
291-
name: Provider Contract Tests
292-
runs-on: ubuntu-latest
293-
steps:
294-
- name: Checkout repository
295-
uses: actions/checkout@v4
296-
297-
- name: Install dependencies
298-
run: npm ci
299-
300-
- name: Configure AWS credentials
301-
uses: aws-actions/configure-aws-credentials@v4
302-
with:
303-
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
304-
role-session-name: templates-ci-contract-tests
305-
aws-region: ${{ env.AWS_REGION }}
306-
307-
- name: Download consumer generated Pact files and run provider contract tests
308-
run: |
309-
export PACT_BUCKET="nhs-notify-${{ secrets.AWS_ACCOUNT_ID }}-${{ env.AWS_REGION }}-main-acct-artefacts"
310-
npm run test:contracts:provider:ci

0 commit comments

Comments
 (0)