-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (150 loc) · 4.8 KB
/
Copy pathci.yml
File metadata and controls
167 lines (150 loc) · 4.8 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: [main]
jobs:
spotless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: "25"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true
- name: Spotless check
run: ./gradlew spotlessCheck --build-cache
changes:
runs-on: ubuntu-latest
outputs:
services: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
merchant-onboarding:merchant-onboarding:
- 'merchant-onboarding/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
merchant-iam:merchant-iam:
- 'merchant-iam/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
api-gateway-iam:api-gateway-iam:
- 'api-gateway-iam/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
compliance-travel-rule:compliance-travel-rule:
- 'compliance-travel-rule/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
fx-liquidity-engine:fx-liquidity-engine:
- 'fx-liquidity-engine/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
payment-orchestrator:payment-orchestrator:
- 'payment-orchestrator/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
fiat-on-ramp:fiat-on-ramp:
- 'fiat-on-ramp/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
blockchain-custody:blockchain-custody:
- 'blockchain-custody/**'
- 'build.gradle.kts'
- 'settings.gradle.kts'
- 'gradle/**'
- 'gradle.properties'
test:
needs: [spotless, changes]
if: needs.changes.outputs.services != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
service: ${{ fromJson(needs.changes.outputs.services) }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
java-version: "25"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true
- name: All tests
env:
TESTCONTAINERS_REUSE_ENABLE: true
run: |
./gradlew \
:${{ matrix.service }}:test \
:${{ matrix.service }}:jacocoTestReport \
:${{ matrix.service }}:integrationTest \
:${{ matrix.service }}:businessTest \
--build-cache --parallel
ci-status:
name: CI Status
runs-on: ubuntu-latest
needs: [spotless, test]
if: always()
steps:
- name: Check results
run: |
if [[ "${{ needs.spotless.result }}" == "failure" || "${{ needs.test.result }}" == "failure" ]]; then
echo "CI failed"
exit 1
fi
echo "CI passed"
sonar:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
java-version: "25"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true
# Switch to Java 21 for Sonar — BouncyCastle multi-release JAR used by the
# SonarQube plugin is not compatible with Java 25 instrumentation
- name: Set up JDK 21 for SonarCloud
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: SonarCloud analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew classes sonar --build-cache -Dsonar.token="$SONAR_TOKEN" -Dsonar.branch.name=${{ github.ref_name }}