Skip to content

Commit 331f867

Browse files
ci (#1)
1 parent 87979d8 commit 331f867

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed

.github/workflows/build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: 'confluent-kafka-dotnet build pipeline'
2+
3+
env:
4+
CONFIGURATION: Release
5+
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
tags: [ '*' ]
11+
pull_request:
12+
branches: [ main ]
13+
14+
jobs:
15+
linux-build:
16+
name: 'Linux x64'
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v3
22+
with:
23+
dotnet-version: '6.0.x'
24+
- name: Build and test
25+
run: |
26+
dotnet restore
27+
make build
28+
make test
29+
30+
osx-build:
31+
name: 'OSX x64'
32+
runs-on: macos-13
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Setup .NET
36+
uses: actions/setup-dotnet@v3
37+
with:
38+
dotnet-version: '6.0.x'
39+
- name: Set ulimit
40+
run: ulimit -n 1024
41+
- name: Build and test
42+
run: |
43+
dotnet restore
44+
make build
45+
make test
46+
47+
windows-build:
48+
name: 'Windows x64'
49+
runs-on: windows-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Setup .NET
53+
uses: actions/setup-dotnet@v3
54+
with:
55+
dotnet-version: '6.0.403'
56+
- name: Build and test
57+
run: |
58+
dotnet restore
59+
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
60+
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.SchemaRegistry.UnitTests/Confluent.SchemaRegistry.UnitTests.csproj
61+
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.SchemaRegistry.Serdes.UnitTests/Confluent.SchemaRegistry.Serdes.UnitTests.csproj
62+
63+
windows-artifacts:
64+
name: 'Windows Artifacts'
65+
needs: windows-build
66+
runs-on: windows-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Setup .NET
70+
uses: actions/setup-dotnet@v3
71+
with:
72+
dotnet-version: '6.0.403'
73+
- name: Install DocFX
74+
run: dotnet tool update -g docfx
75+
- name: Build and create packages
76+
run: |
77+
dotnet restore
78+
dotnet build Confluent.Kafka.sln -c $env:CONFIGURATION
79+
80+
# Different packaging for tagged vs untagged builds
81+
if ($env:GITHUB_REF -match '^refs/tags/') {
82+
$suffix = ""
83+
} else {
84+
$suffix = "--version-suffix ci-$env:GITHUB_RUN_ID"
85+
}
86+
87+
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj -c $env:CONFIGURATION $suffix --output artifacts
88+
dotnet pack src/Confluent.SchemaRegistry/Confluent.SchemaRegistry.csproj -c $env:CONFIGURATION $suffix --output artifacts
89+
dotnet pack src/Confluent.SchemaRegistry.Serdes.Avro/Confluent.SchemaRegistry.Serdes.Avro.csproj -c $env:CONFIGURATION $suffix --output artifacts
90+
dotnet pack src/Confluent.SchemaRegistry.Serdes.Protobuf/Confluent.SchemaRegistry.Serdes.Protobuf.csproj -c $env:CONFIGURATION $suffix --output artifacts
91+
dotnet pack src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj -c $env:CONFIGURATION $suffix --output artifacts
92+
93+
docfx doc/docfx.json
94+
tar -czf artifacts/docs-$env:GITHUB_RUN_ID.zip doc/_site/*
95+
- name: Upload artifacts
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: build-artifacts
99+
path: artifacts/

.github/workflows/integration.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: 'Integration Tests'
2+
3+
env:
4+
CONFIGURATION: Release
5+
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
6+
SEMAPHORE_SKIP_FLAKY_TESTS: 'true'
7+
8+
on:
9+
push:
10+
branches: [ main ]
11+
pull_request:
12+
branches: [ main ]
13+
14+
jobs:
15+
integration-tests:
16+
name: 'Integration tests'
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v3
22+
with:
23+
dotnet-version: '6.0.x'
24+
- name: Login to DockerHub
25+
uses: docker/login-action@v2
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USER }}
28+
password: ${{ secrets.DOCKERHUB_APIKEY }}
29+
30+
- name: Classic Protocol Tests
31+
run: |
32+
cd test/docker && docker-compose up -d && sleep 30 && cd ../..
33+
dotnet restore
34+
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
35+
36+
- name: Consumer Protocol Tests
37+
run: |
38+
cd test/docker && docker-compose -f docker-compose-kraft.yaml up -d && cd ../..
39+
sleep 300
40+
export TEST_CONSUMER_GROUP_PROTOCOL=consumer
41+
dotnet restore
42+
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
43+
44+
schema-registry-tests:
45+
name: 'Schema registry and serdes integration tests'
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- uses: actions/checkout@v4
49+
- name: Setup .NET
50+
uses: actions/setup-dotnet@v3
51+
with:
52+
dotnet-version: '6.0.x'
53+
- name: Login to DockerHub
54+
uses: docker/login-action@v2
55+
with:
56+
username: ${{ secrets.DOCKERHUB_USER }}
57+
password: ${{ secrets.DOCKERHUB_APIKEY }}
58+
- name: Run Tests
59+
run: |
60+
cd test/docker && docker-compose up -d && cd ../..
61+
dotnet restore
62+
cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..

0 commit comments

Comments
 (0)