-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (123 loc) · 4.33 KB
/
Copy pathci.yml
File metadata and controls
142 lines (123 loc) · 4.33 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
name: CI
on:
push:
branches: [main]
pull_request:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
permissions:
contents: read
actions: write
jobs:
# ── Build ──────────────────────────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: actions/cache@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: nuget-${{ runner.os }}-${{ hashFiles('**/Directory.Packages.props', '**/*.csproj') }}
restore-keys: nuget-${{ runner.os }}-
- name: Restore
run: dotnet restore RayTree.slnx
- name: Build
run: dotnet build RayTree.slnx --no-restore -c Release
- name: Upload build output
uses: actions/upload-artifact@v4
with:
name: build-output
retention-days: 1
path: |
src/**/bin/Release
tests/**/bin/Release
# ── Unit tests (no Docker) ─────────────────────────────────────────────────
unit-tests:
name: Unit / ${{ matrix.name }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: Core
project: tests/RayTree.Core.Tests
- name: InMemory
project: tests/RayTree.Plugins.InMemory.Tests
- name: EntityFrameworkCore
project: tests/RayTree.EntityFrameworkCore.Tests
- name: Compressor.Brotli
project: tests/RayTree.Plugins.Compressors.Brotli.Tests
- name: Compressor.Gzip
project: tests/RayTree.Plugins.Compressors.Gzip.Tests
- name: Compressor.Lz4
project: tests/RayTree.Plugins.Compressors.Lz4.Tests
- name: Serializer.Json
project: tests/RayTree.Plugins.Serializers.Json.Tests
- name: Serializer.MessagePack
project: tests/RayTree.Plugins.Serializers.MessagePack.Tests
- name: Serializer.Protobuf
project: tests/RayTree.Plugins.Serializers.Protobuf.Tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
- name: Test
run: |
dotnet test ${{ matrix.project }} \
--no-build -c Release \
--logger "trx;LogFileName=results.trx" \
--results-directory "TestResults/${{ matrix.project }}"
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-results-${{ matrix.name }}
path: TestResults/**/results.trx
# ── Integration tests (Testcontainers / Docker) ────────────────────────────
integration-tests:
name: Integration / ${{ matrix.name }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: PostgreSQL
project: tests/RayTree.Plugins.PostgreSQL.Tests
- name: RabbitMQ
project: tests/RayTree.Plugins.RabbitMQ.Tests
- name: Kafka
project: tests/RayTree.Plugins.Kafka.Tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Download build output
uses: actions/download-artifact@v4
with:
name: build-output
- name: Test
run: |
dotnet test ${{ matrix.project }} \
--no-build -c Release \
--logger "trx;LogFileName=results.trx" \
--results-directory "TestResults/${{ matrix.project }}"
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-results-${{ matrix.name }}
path: TestResults/**/results.trx