generated from finos/software-project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
241 lines (200 loc) · 6.24 KB
/
ci.yml
File metadata and controls
241 lines (200 loc) · 6.24 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: CI
on:
push:
branches:
- main
- setup/**
pull_request:
branches:
- main
jobs:
format-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
- name: Check formatting
run: mise run fmt-check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
- name: Set up Go workspace
run: mise run workspace:setup
- name: Install golangci-lint from source
run: |
# Build golangci-lint from source to support Go 1.25.5
# Pre-built binaries don't support Go 1.25 yet
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run linters
run: mise run lint
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
# On Windows, use inline mise tasks (file-based tasks don't work on Windows)
- name: Set up Go workspace (Windows)
if: runner.os == 'Windows'
run: mise run windows:workspace-setup
- name: Set up Go workspace (Unix)
if: runner.os != 'Windows'
run: mise run workspace:setup
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: mise run windows:test
- name: Run tests with coverage and JUnit reports (Unix)
if: runner.os != 'Windows'
run: mise run test-junit
- name: Upload coverage artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: code-coverage
path: coverage.out
retention-days: 7
- name: Upload test results
if: always() && matrix.os != 'windows-latest'
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}
path: test-results/*.xml
retention-days: 7
- name: Publish test results
if: always() && matrix.os != 'windows-latest'
uses: test-summary/action@v2.4
with:
paths: "test-results/*.xml"
show: "all"
- name: Upload to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [amd64, arm64]
exclude:
# Windows arm64 builds aren't well supported in GitHub Actions yet
- os: windows-latest
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
# On Windows, use inline mise tasks (file-based tasks don't work on Windows)
- name: Set up Go workspace (Windows)
if: runner.os == 'Windows'
run: mise run windows:workspace-setup
- name: Set up Go workspace (Unix)
if: runner.os != 'Windows'
run: mise run workspace:setup
- name: Build binary (Windows)
if: runner.os == 'Windows'
env:
GOARCH: ${{ matrix.arch }}
run: mise run windows:build
- name: Build binary (Unix)
if: runner.os != 'Windows'
env:
GOOS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
GOARCH: ${{ matrix.arch }}
run: mise run build
- name: Test binary execution
if: matrix.arch == 'amd64'
run: |
./bin/morphir${{ matrix.os == 'windows-latest' && '.exe' || '' }} --version
verify:
name: Verify All Modules
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
- name: Set up Go workspace
run: mise run workspace:setup
- name: Verify modules build
run: mise run verify
coverage-report:
name: Coverage Report
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
actions: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download coverage artifact
uses: actions/download-artifact@v8
with:
name: code-coverage
- name: Post coverage comment
uses: fgrosse/go-coverage-report@v1.2.0
continue-on-error: true # Allow failure if baseline coverage doesn't exist yet
with:
coverage-artifact-name: "code-coverage"
coverage-file-name: "coverage.out"
root-package: "github.com/finos/morphir"
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
- name: Set up Go workspace
run: mise run workspace:setup
- name: Run morphir-elm integration tests
run: mise run test:integration-morphir-elm
- name: Run all integration tests
run: mise run test:integration
test-external-consumption:
name: Test External Consumption (Release PRs)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'release') || contains(github.event.pull_request.labels.*.name, 'release'))
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2026.1.1
- name: Test cmd/morphir builds without go.work
run: mise run test-external