-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (141 loc) · 4.5 KB
/
Copy pathci.yml
File metadata and controls
161 lines (141 loc) · 4.5 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
name: CI
permissions:
contents: read
pull-requests: read
on:
pull_request:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
java: ${{ steps.filter.outputs.java }}
identity: ${{ steps.filter.outputs.identity }}
go: ${{ steps.filter.outputs.go }}
ci: ${{ steps.filter.outputs.ci }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect changed paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
docs:
- '**/*.md'
- 'docs/**'
- 'scripts/ci/**'
- '.markdownlint.json'
java:
- 'services/java/**'
identity:
- 'services/java/identity-service/**'
- 'services/java/pom.xml'
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
ci:
- '.github/workflows/ci.yml'
docs-and-contracts:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.docs == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@v17
with:
globs: "**/*.md"
- name: Validate required contract files
run: bash scripts/ci/check-contract-files.sh
java-quality:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.java == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Java validation
run: |
if [ -f services/java/pom.xml ]; then
mvn -B -q -f services/java/pom.xml -DskipTests validate
else
echo "Java parent module not present; skipping validation."
fi
- name: Java lint (spotless + checkstyle)
run: |
if [ -f services/java/pom.xml ]; then
mvn -B -q -f services/java/pom.xml spotless:check checkstyle:check
else
echo "Java parent module not present; skipping lint."
fi
java-tests-identity:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.identity == 'true' || needs.changes.outputs.java == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Identity service tests and coverage check
run: |
if [ -f services/java/identity-service/pom.xml ]; then
mvn -B -q -f services/java/pom.xml -pl identity-service -am verify
else
echo "Identity service not scaffolded yet; skipping tests."
fi
- name: Upload identity test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: identity-surefire-reports
path: services/java/identity-service/target/surefire-reports/**
if-no-files-found: ignore
- name: Upload identity coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: identity-jacoco-report
path: services/java/identity-service/target/site/jacoco/**
if-no-files-found: ignore
go-quality:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Go test
run: |
if [ -f go.mod ]; then
go test ./...
else
echo "No Go module yet; skipping Go validation."
fi
- name: Go lint (golangci-lint)
if: ${{ hashFiles('**/go.mod') != '' }}
uses: golangci/golangci-lint-action@v6
with:
version: v1.60