Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-krystianc committed Dec 12, 2024
1 parent 87979d8 commit e759ac5
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: 'confluent-kafka-dotnet build pipeline'

env:
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'

on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
branches: [ main ]

jobs:
linux-build:
name: 'Linux x64'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Build and test
run: |
dotnet restore
make build
make test
osx-build:
name: 'OSX x64'
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Set ulimit
run: ulimit -n 1024
- name: Build and test
run: |
dotnet restore
make build
make test
windows-build:
name: 'Windows x64'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.403'
- name: Build and test
run: |
dotnet restore
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.SchemaRegistry.UnitTests/Confluent.SchemaRegistry.UnitTests.csproj
dotnet test -c $env:CONFIGURATION --no-build test/Confluent.SchemaRegistry.Serdes.UnitTests/Confluent.SchemaRegistry.Serdes.UnitTests.csproj
windows-artifacts:
name: 'Windows Artifacts'
needs: windows-build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.403'
- name: Install DocFX
run: dotnet tool update -g docfx
- name: Build and create packages
run: |
dotnet restore
dotnet build Confluent.Kafka.sln -c $env:CONFIGURATION
# Different packaging for tagged vs untagged builds
if ($env:GITHUB_REF -match '^refs/tags/') {
$suffix = ""
} else {
$suffix = "--version-suffix ci-$env:GITHUB_RUN_ID"
}
dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj -c $env:CONFIGURATION $suffix --output artifacts
dotnet pack src/Confluent.SchemaRegistry/Confluent.SchemaRegistry.csproj -c $env:CONFIGURATION $suffix --output artifacts
dotnet pack src/Confluent.SchemaRegistry.Serdes.Avro/Confluent.SchemaRegistry.Serdes.Avro.csproj -c $env:CONFIGURATION $suffix --output artifacts
dotnet pack src/Confluent.SchemaRegistry.Serdes.Protobuf/Confluent.SchemaRegistry.Serdes.Protobuf.csproj -c $env:CONFIGURATION $suffix --output artifacts
dotnet pack src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj -c $env:CONFIGURATION $suffix --output artifacts
docfx doc/docfx.json
tar -czf artifacts/docs-$env:GITHUB_RUN_ID.zip doc/_site/*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: artifacts/
62 changes: 62 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Integration Tests'

env:
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
SEMAPHORE_SKIP_FLAKY_TESTS: 'true'

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
integration-tests:
name: 'Integration tests'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_APIKEY }}

- name: Classic Protocol Tests
run: |
cd test/docker && docker-compose up -d && sleep 30 && cd ../..
dotnet restore
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
- name: Consumer Protocol Tests
run: |
cd test/docker && docker-compose -f docker-compose-kraft.yaml up -d && cd ../..
sleep 300
export TEST_CONSUMER_GROUP_PROTOCOL=consumer
dotnet restore
cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..
schema-registry-tests:
name: 'Schema registry and serdes integration tests'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_APIKEY }}
- name: Run Tests
run: |
cd test/docker && docker-compose up -d && cd ../..
dotnet restore
cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../..

0 comments on commit e759ac5

Please sign in to comment.