Skip to content

Commit 583c4bd

Browse files
committed
adding github workflow
1 parent 12ef2da commit 583c4bd

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Run Provider Pact Publish Script
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
publish-provider-pacts:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
PACT_BROKER_URL: https://hmcts-dts.pactflow.io
18+
PACT_BROKER_HOST: hmcts-dts.pactflow.io
19+
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
20+
PACT_VERIFIER_PUBLISH_RESULTS: true
21+
GIT_COMMIT: ${{ github.sha }}
22+
GIT_BRANCH: ${{ github.ref_name }}
23+
PACT_ENV: dev/pactTest
24+
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Set up JDK 21
31+
uses: actions/setup-java@v3
32+
with:
33+
distribution: temurin
34+
java-version: 21
35+
36+
- name: Install Pact CLI
37+
run: npm install -g @pact-foundation/pact-cli
38+
39+
- name: Make provider script executable
40+
run: chmod +x publish-pacts.sh
41+
42+
- name: Run provider publish script
43+
run: ./publish-pacts.sh

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,5 +295,4 @@ dependencies {
295295
systemProperty 'pact.broker.host', System.getenv('PACT_BROKER_HOST')
296296
systemProperty 'pact.env', System.getenv('PACT_ENV')
297297
}
298-
299298
}

src/test/java/uk/gov/hmcts/cp/pact/provider/CourtScheduleProviderPactTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ void setupTarget(PactVerificationContext context) {
5050
System.out.println("pact.verifier.publishResults: " + System.getProperty("pact.verifier.publishResults"));
5151
}
5252

53-
/* @BeforeEach
54-
public void setupTestTarget(PactVerificationContext context) {
55-
context.setTarget(new HttpTestTarget("localhost", 8080));
56-
}*/
57-
5853
@State("court schedule for case 456789 exists")
5954
public void setupCourtSchedule() {
6055
courtScheduleRepository.clearAll();

0 commit comments

Comments
 (0)