Skip to content

Commit 4789608

Browse files
ci
1 parent 843d68f commit 4789608

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

.github/workflows/build.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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+
pull_request:
10+
11+
jobs:
12+
13+
integration-tests:
14+
name: 'Integration tests'
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v3
20+
with:
21+
dotnet-version: '6.0.x'
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USER }}
26+
password: ${{ secrets.DOCKERHUB_APIKEY }}
27+
28+
- name: Classic Protocol Tests
29+
run: |
30+
cd test/docker && docker-compose up -d && sleep 30 && cd ../..
31+
dotnet restore
32+
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
33+
34+
- name: Consumer Protocol Tests
35+
run: |
36+
cd test/docker && docker-compose -f docker-compose-kraft.yaml up -d && cd ../..
37+
sleep 300
38+
export TEST_CONSUMER_GROUP_PROTOCOL=consumer
39+
dotnet restore
40+
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
41+
42+
linux-build:
43+
name: 'Linux x64'
44+
runs-on: ubuntu-20.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Setup .NET
48+
uses: actions/setup-dotnet@v3
49+
with:
50+
dotnet-version: '6.0.x'
51+
- name: Build and test
52+
run: |
53+
dotnet restore
54+
make build
55+
make test
56+
57+
osx-build:
58+
name: 'OSX x64'
59+
runs-on: macos-13
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: Setup .NET
63+
uses: actions/setup-dotnet@v3
64+
with:
65+
dotnet-version: '6.0.x'
66+
- name: Set ulimit
67+
run: ulimit -n 1024
68+
- name: Build and test
69+
run: |
70+
dotnet restore
71+
make build
72+
make test
73+
74+
windows-build:
75+
name: 'Windows x64'
76+
runs-on: windows-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- name: Setup .NET
80+
uses: actions/setup-dotnet@v3
81+
with:
82+
dotnet-version: '6.0.403'
83+
- name: Build and test
84+
run: |
85+
dotnet restore
86+
dotnet test -c $env:CONFIGURATION test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
87+
88+
windows-artifacts:
89+
name: 'Windows Artifacts'
90+
needs: windows-build
91+
runs-on: windows-latest
92+
steps:
93+
- uses: actions/checkout@v4
94+
- name: Setup .NET
95+
uses: actions/setup-dotnet@v3
96+
with:
97+
dotnet-version: '6.0.403'
98+
- name: Install DocFX
99+
run: dotnet tool update -g docfx
100+
- name: Build and create packages
101+
run: |
102+
dotnet restore
103+
dotnet build Confluent.Kafka.sln -c $env:CONFIGURATION
104+
105+
# Different packaging for tagged vs untagged builds
106+
if ($env:GITHUB_REF -match '^refs/tags/') {
107+
$suffix = ""
108+
$vsuffix = ""
109+
} else {
110+
$suffix = "ci-$env:GITHUB_RUN_ID"
111+
$vsuffix = "--version-suffix"
112+
}
113+
114+
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj --output artifacts -c $env:CONFIGURATION $vsuffix $suffix
115+
116+
- name: Upload artifacts
117+
uses: actions/upload-artifact@v3
118+
with:
119+
name: build-artifacts
120+
path: artifacts/

0 commit comments

Comments
 (0)