-
Notifications
You must be signed in to change notification settings - Fork 0
224 lines (189 loc) · 6.43 KB
/
Copy pathci-develop.yml
File metadata and controls
224 lines (189 loc) · 6.43 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
name: CI - Build & Test
on:
push:
branches: [develop]
paths:
- 'src/**'
- 'scripts/**'
- '.github/workflows/**'
- 'Package.swift'
workflow_dispatch:
inputs:
checkout_ref:
description: 'Optional branch, tag, or commit SHA to test'
required: false
type: string
jobs:
test-multiplatform:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Build TypeScript client
working-directory: src/Cocoar.SignalARRR.Typescript
run: npm install && npm run build
- name: Build and test
working-directory: src
env:
SIGNALARRR_TEST_DIAGNOSTICS: 'true'
SIGNALARRR_TEST_DIAGNOSTICS_LOG_FILE: ${{ runner.temp }}/signalarrr-diagnostics-${{ matrix.os }}.log
run: |
$testFilter = 'Type!=Performance'
if ('${{ matrix.os }}' -ne 'ubuntu-latest') {
$testFilter = '(Type!=Performance)&(FullyQualifiedName!~BackplaneIntegrationTests)'
}
dotnet test Cocoar.SignalARRR.slnx -c Release --verbosity normal --framework net10.0 --filter $testFilter
shell: pwsh
- name: Dump SignalARRR diagnostics
if: ${{ always() }}
shell: pwsh
env:
SIGNALARRR_TEST_DIAGNOSTICS_LOG_FILE: ${{ runner.temp }}/signalarrr-diagnostics-${{ matrix.os }}.log
run: |
if (Test-Path $env:SIGNALARRR_TEST_DIAGNOSTICS_LOG_FILE) {
Write-Host '=== SignalARRR diagnostics ==='
Get-Content $env:SIGNALARRR_TEST_DIAGNOSTICS_LOG_FILE
Write-Host '=== End SignalARRR diagnostics ==='
} else {
Write-Host 'No SignalARRR diagnostics log found.'
}
test-swift:
name: Test Swift package
runs-on: macos-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Build Swift package
run: swift build
- name: Run Swift tests
run: swift test
integration-test:
name: Cross-platform integration tests
runs-on: macos-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Build TypeScript client
working-directory: src/Cocoar.SignalARRR.Typescript
run: npm install && npm run build
- name: Run integration tests (.NET + TypeScript + Swift)
env:
DOTNET_TARGET_FRAMEWORK: net10.0
DOTNET_TEST_FILTER: "(Type!=Performance)&(FullyQualifiedName!~BackplaneIntegrationTests)"
run: chmod +x scripts/run-integration-tests.sh && scripts/run-integration-tests.sh
build-artifacts:
name: Build alpha artifacts
runs-on: ubuntu-latest
needs: [test-multiplatform, test-swift, integration-test]
permissions:
packages: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.x'
- name: Calculate version
id: gv
uses: gittools/actions/gitversion/execute@v4
- name: Pack NuGet packages (alpha)
working-directory: src
run: dotnet pack Cocoar.SignalARRR.slnx -c Release -o ../artifacts -p:Version=${{ steps.gv.outputs.SemVer }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Build and pack npm alpha
working-directory: src/Cocoar.SignalARRR.Typescript
run: |
npm install
npm version ${{ steps.gv.outputs.SemVer }} --no-git-tag-version --allow-same-version
npm run build
npm pack --pack-destination "$GITHUB_WORKSPACE/artifacts"
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: prerelease-${{ steps.gv.outputs.SemVer }}
path: ${{ github.workspace }}/artifacts
retention-days: 7
build-fullframework:
name: Build & test .NET Framework client
runs-on: windows-latest
needs: [test-multiplatform]
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.checkout_ref || github.sha }}
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4
with:
versionSpec: '6.x'
- name: Calculate version
id: gv
uses: gittools/actions/gitversion/execute@v4
- name: Test FullFramework client
run: dotnet test src/tests/Cocoar.SignalARRR.Client.FullFramework.Tests/Cocoar.SignalARRR.Client.FullFramework.Tests.csproj -c Release --verbosity normal
- name: Pack FullFramework NuGet
run: dotnet pack src/Cocoar.SignalARRR.Client.FullFramework/Cocoar.SignalARRR.Client.FullFramework.csproj -c Release -o artifacts -p:Version=${{ steps.gv.outputs.SemVer }}
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: prerelease-fullframework-${{ steps.gv.outputs.SemVer }}
path: ${{ github.workspace }}/artifacts
retention-days: 7