-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (113 loc) · 3.99 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI-Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ci_${{ github.ref }}
cancel-in-progress: true
jobs:
ci-contract-testing:
runs-on: ubuntu-latest
needs:
- pact-http
- pact-messaging
- spring-cloud-contract-http
- spring-cloud-contract-messaging
steps:
- run: echo "CI-Build completed!"
pact-http:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Delete Contracts from Provider
run: rm ./pact/http/provider/src/test/pacts/*.json
- name: Build Consumer One
run: ./gradlew :pact:http:consumer-one:build
- name: Copy Contracts of Consumer One to Provider
run: cp ./pact/http/consumer-one/build/pacts/*.json ./pact/http/provider/src/test/pacts
- name: Build Consumer Two
run: ./gradlew :pact:http:consumer-two:build
- name: Copy Contracts of Consumer Two to Provider
run: cp ./pact/http/consumer-two/build/pacts/*.json ./pact/http/provider/src/test/pacts
- name: Build Provider
run: ./gradlew :pact:http:provider:build
- name: Upload Test Results
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results_pact-http
path: "**/build/reports/tests"
pact-messaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Delete Contracts from Provider
run: rm ./pact/messaging/provider/src/test/pacts/*.json
- name: Build Consumer
run: ./gradlew :pact:messaging:consumer:build
- name: Copy Contracts of Consumer to Provider
run: cp ./pact/messaging/consumer/build/pacts/*.json ./pact/messaging/provider/src/test/pacts
- name: Build Provider
run: ./gradlew :pact:messaging:provider:build
- name: Upload Test Results
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results_pact-messaging
path: "**/build/reports/tests"
spring-cloud-contract-http:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Provider & Publish Stubs
run: ./gradlew :spring-cloud-contract:http:provider:build :spring-cloud-contract:http:provider:publishToMavenLocal
- name: Build Consumer One
run: ./gradlew :spring-cloud-contract:http:consumer-one:build
- name: Build Consumer Two
run: ./gradlew :spring-cloud-contract:http:consumer-two:build
- name: Upload Test Results
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results_spring-cloud-contract-http
path: "**/build/reports/tests"
spring-cloud-contract-messaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Provider & Publish Stubs
run: ./gradlew :spring-cloud-contract:messaging:provider:build :spring-cloud-contract:messaging:provider:publishToMavenLocal
- name: Build Consumer
run: ./gradlew :spring-cloud-contract:messaging:consumer:build
- name: Upload Test Results
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results_spring-cloud-contract-messaging
path: "**/build/reports/tests"