Skip to content

Commit a84e65b

Browse files
committed
Merge branch 'master' of github.com:kurrent-io/KurrentDB into w1am/dev-965-refactor-system-components-to-use-multi-stream-append
2 parents d8d3ad9 + d4c134d commit a84e65b

File tree

370 files changed

+3770
-2489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+3770
-2489
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Dockerfile
33
testresults/
44
**/bin/
55
**/obj/
6-
**/global.json
76
**/Dockerfile*
87
**/.dockerignore*
98
**/*.user

.github/workflows/build-container-bookworm-slim.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/build-container-jammy.yml renamed to .github/workflows/build-container-noble.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Jammy Container
1+
name: Build Noble Container
22

33
on:
44
pull_request:
@@ -22,5 +22,5 @@ jobs:
2222
build-container:
2323
uses: ./.github/workflows/build-container-reusable.yml
2424
with:
25-
container-runtime: jammy
25+
container-runtime: noble
2626

.github/workflows/build-container-reusable.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,30 @@ on:
88
type: string
99

1010
jobs:
11+
# find all projects in the slnf that end .Tests.csproj.
12+
discover-projects:
13+
runs-on: ubuntu-latest
14+
name: discover-projects
15+
outputs:
16+
modules: ${{ steps.discover.outputs.modules }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- id: discover
20+
run: |
21+
modules=$(cat src/KurrentDB.ContainerTests.slnf | jq -c '[.solution.projects[] | select(test("(?i)\\.tests\\.csproj$")) | gsub("\\\\"; "/")]')
22+
echo "modules=$modules" >> $GITHUB_OUTPUT
1123
build-container:
1224
runs-on: ubuntu-latest
13-
name: ci/github/build-${{ inputs.container-runtime }}
25+
name: build-${{ inputs.container-runtime }}
1426
steps:
1527
-
1628
name: Checkout
1729
uses: actions/checkout@v4
1830
-
19-
name: Install net8.0
31+
name: Install net10.0
2032
uses: actions/setup-dotnet@v3
2133
with:
22-
dotnet-version: 8.0.x
34+
dotnet-version: 10.0.x
2335
-
2436
name: Setup QEMU
2537
uses: docker/setup-qemu-action@v2
@@ -41,10 +53,7 @@ jobs:
4153
key: "${{ inputs.container-runtime }}"
4254
map: |
4355
{
44-
"jammy": {
45-
"runtime": "linux-x64"
46-
},
47-
"bookworm-slim": {
56+
"noble": {
4857
"runtime": "linux-x64"
4958
},
5059
"alpine": {
@@ -77,6 +86,33 @@ jobs:
7786
build-args: |
7887
CONTAINER_RUNTIME=${{ inputs.container-runtime }}
7988
RUNTIME=${{ steps.variables.outputs.runtime }}
89+
-
90+
name: Save test image as artifact
91+
run: docker save kurrentdb-test -o kurrentdb-test.tar
92+
-
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: kurrentdb-test
96+
path: kurrentdb-test.tar
97+
retention-days: 1
98+
99+
run-tests:
100+
needs: [discover-projects, build-container]
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
module: ${{ fromJson(needs.discover-projects.outputs.modules) }}
105+
runs-on: ubuntu-latest
106+
name: ${{ matrix.module }}
107+
steps:
108+
-
109+
uses: actions/download-artifact@v4
110+
with:
111+
name: kurrentdb-test
112+
-
113+
name: Load Docker image
114+
run: docker load -i kurrentdb-test.tar
115+
80116
# pass env vars so that GitHubActionsTestLogger can populate GitHub job summary
81117
-
82118
name: Run Tests
@@ -92,11 +128,23 @@ jobs:
92128
--env GITHUB_WORKSPACE=${{ github.workspace }}
93129
--env GITHUB_SHA=${{ github.sha }}
94130
kurrentdb-test
131+
dotnet test
132+
--results-directory /build/test-results
133+
--configuration release
134+
--project /build/src/${{ matrix.module }}
135+
-
136+
name: Remove slashes
137+
id: remove_slashes
138+
shell: bash
139+
run: |
140+
base="${{ matrix.module }}"
141+
safe="${base//\//-}"
142+
echo "value=$safe" >> $GITHUB_OUTPUT
95143
-
96144
name: Publish Test Results (All)
97145
uses: actions/upload-artifact@v4
98146
if: always()
99147
with:
100-
name: test-results-${{ inputs.container-runtime }}
148+
name: test-results-${{ steps.remove_slashes.outputs.value }}
101149
path: |
102150
test-results/**/*.trx

.github/workflows/build-reusable.yml

Lines changed: 64 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,40 @@ on:
66
os:
77
required: true
88
type: string
9-
arch:
10-
required: true
11-
type: string
129
cs_symbols:
1310
required: false
1411
type: string
1512
default: ""
1613

1714
jobs:
15+
# todo, consider matrix of slnf files to group assemblies together. each job could run a separate slnf.
16+
# this may be more practical after githubactionstestrunner supports MTP, making failures easier to understand at a glance.
17+
discover-projects:
18+
runs-on: ubuntu-latest
19+
name: discover-projects-${{ inputs.os }}
20+
outputs:
21+
modules: ${{ steps.discover.outputs.modules }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- id: discover
25+
run: |
26+
find src -maxdepth 3 -name "*.Tests.csproj" > projects.txt
27+
echo "src/KurrentDB/KurrentDB.csproj" >> projects.txt
28+
modules=$(cat projects.txt | jq -R . | jq -sc .)
29+
echo "modules=$modules" >> $GITHUB_OUTPUT
30+
# each assembly is built in its own job because the repo is small and the build is fairly quick.
31+
# building it once and copying the build output between jobs is much slower
1832
build:
33+
needs: discover-projects
1934
env:
2035
DB_IMAGE: kurrentdb-test-container
2136
strategy:
2237
fail-fast: false
2338
matrix:
2439
configuration: [release]
40+
module: ${{ fromJson(needs.discover-projects.outputs.modules) }}
2541
runs-on: ${{ inputs.os }}
26-
name: ci/github/build-${{ inputs.os }}
42+
name: ${{ matrix.module }}
2743
steps:
2844
-
2945
name: Install Azure Emulator
@@ -32,14 +48,15 @@ jobs:
3248
npm install -g azurite
3349
azurite --location /tmp/azurite &
3450
curl -I http://127.0.0.1:10000/ --retry 5 --retry-delay 1 --retry-connrefused
35-
-
36-
name: Free Disk Space (Ubuntu)
37-
if: ${{ !startsWith(inputs.os, 'windows') }}
38-
uses: jlumbroso/[email protected]
39-
with:
40-
tool-cache: false
41-
dotnet: false
42-
docker-images: false
51+
# takes time and may no longer be necessary now that each step only does one assembly
52+
# -
53+
# name: Free Disk Space (Ubuntu)
54+
# if: ${{ !startsWith(inputs.os, 'windows') }}
55+
# uses: jlumbroso/[email protected]
56+
# with:
57+
# tool-cache: false
58+
# dotnet: false
59+
# docker-images: false
4360
-
4461
name: Checkout
4562
uses: actions/checkout@v4
@@ -48,12 +65,20 @@ jobs:
4865
if: ${{ !startsWith(inputs.os, 'windows') }}
4966
uses: docker/setup-buildx-action@v2
5067
-
51-
name: Install net8.0
68+
name: Install net10.0
5269
uses: actions/setup-dotnet@v3
5370
with:
54-
dotnet-version: 8.0.x
71+
dotnet-version: 10.0.x
72+
-
73+
name: Use nuget cache
74+
uses: actions/cache@v4
75+
with:
76+
path: ~/.nuget/packages
77+
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
78+
restore-keys: |
79+
nuget-${{ runner.os }}-
5580
-
56-
name: Clear Nuget Cache
81+
name: Clear Nuget Config
5782
shell: powershell
5883
if: ${{ startsWith(inputs.os, 'windows') }}
5984
run: |
@@ -64,16 +89,21 @@ jobs:
6489
-
6590
name: Compile
6691
shell: bash
67-
run: |
68-
dotnet build --configuration ${{ matrix.configuration }} -p:Platform=${{ inputs.arch }} src/KurrentDB.sln
92+
run: >
93+
dotnet build
94+
--configuration ${{ matrix.configuration }}
95+
-p:DefineConstants=${{ inputs.cs_symbols }}
96+
${{ matrix.module }}
6997
-
7098
name: Verify Build
99+
if: ${{ matrix.module == 'src/KurrentDB/KurrentDB.csproj' }}
71100
shell: bash
72101
run: |
73-
dotnet run --project src/KurrentDB --configuration ${{ matrix.configuration }} -- --insecure --what-if
102+
dotnet run --project ${{ matrix.module }} --configuration ${{ matrix.configuration }} -- --insecure --what-if
103+
# so that the oauth tests have an up to date server image to run against
74104
-
75105
name: Build Test Image
76-
if: ${{ !startsWith(inputs.os, 'windows') }}
106+
if: ${{ matrix.module == 'src/KurrentDB.Auth.OAuth.Tests/KurrentDB.Auth.OAuth.Tests.csproj' && !startsWith(inputs.os, 'windows') }}
77107
uses: docker/build-push-action@v4
78108
with:
79109
context: .
@@ -82,27 +112,28 @@ jobs:
82112
tags: ${{ env.DB_IMAGE }}
83113
-
84114
name: Run Tests
115+
if: ${{ endsWith(matrix.module, '.Tests.csproj') }}
85116
shell: bash
86117
run: >
87118
dotnet test
88-
--configuration ${{ matrix.configuration }}
89-
-p:Platform=${{ inputs.arch }}
90-
-p:DefineConstants=${{ inputs.cs_symbols }}
91-
--blame
92-
--blame-hang-timeout 5min
93-
--blame-hang-dump-type mini
94-
--settings ./ci/ci.local.runsettings
95-
--logger:GitHubActions
96-
--logger:trx
97-
--logger:"console;verbosity=normal"
98119
--results-directory $(pwd)/test-results
99-
src/KurrentDB.sln
100-
-- --report-trx --results-directory $(pwd)/test-results
120+
--no-build
121+
--configuration ${{ matrix.configuration }}
122+
--project ${{ matrix.module }}
123+
-
124+
name: Remove slashes
125+
if: ${{ endsWith(matrix.module, '.Tests.csproj') }}
126+
id: remove_slashes
127+
shell: bash
128+
run: |
129+
base="${{ matrix.module }}"
130+
safe="${base//\//-}"
131+
echo "value=$safe" >> $GITHUB_OUTPUT
101132
-
102133
name: Publish Test Results (All)
103134
uses: actions/upload-artifact@v4
104-
if: always()
135+
if: ${{ endsWith(matrix.module, '.Tests.csproj') }}
105136
with:
106-
name: test-results-${{ matrix.configuration }}-${{ inputs.os }}
137+
name: test-results-${{ steps.remove_slashes.outputs.value }}
107138
path: |
108139
test-results/*.trx

.github/workflows/build-ubuntu-20.04-arm64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ jobs:
2222
uses: ./.github/workflows/build-reusable.yml
2323
with:
2424
os: ubuntu-20.04-arm64
25-
arch: arm64
2625
secrets: inherit

.github/workflows/build-ubuntu-22.04.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Ubuntu 22.04
1+
name: Build Ubuntu 22.04 (Jammy)
22

33
on:
44
pull_request:
@@ -23,6 +23,5 @@ jobs:
2323
uses: ./.github/workflows/build-reusable.yml
2424
with:
2525
os: ubuntu-22.04
26-
arch: x64
2726
cs_symbols: "RUN_AZ_TESTS"
2827
secrets: inherit

.github/workflows/build-windows-2022.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ jobs:
2323
uses: ./.github/workflows/build-reusable.yml
2424
with:
2525
os: windows-2022
26-
arch: x64
2726
secrets: inherit

.github/workflows/common.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
name: Checkout
2828
uses: actions/checkout@v4
2929
-
30-
name: Install net8.0
30+
name: Install net10.0
3131
uses: actions/setup-dotnet@v3
3232
with:
33-
dotnet-version: 8.0.x
33+
dotnet-version: 10.0.x
3434
-
3535
name: Scan for Vulnerabilities
3636
run: |

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ StyleCopReport.xml
191191
*.ipdb
192192
*.pgc
193193
*.pgd
194-
*.rsp
195194
*.sbr
196195
*.tlb
197196
*.tli

0 commit comments

Comments
 (0)