|
| 1 | +version: v1.0 |
| 2 | +name: 'confluent-kafka-dotnet build pipeline' |
| 3 | +agent: |
| 4 | + machine: |
| 5 | + type: s1-prod-ubuntu20-04-amd64-1 |
| 6 | +global_job_config: |
| 7 | + prologue: |
| 8 | + commands: |
| 9 | + - checkout |
| 10 | + env_vars: |
| 11 | + - name: CONFIGURATION |
| 12 | + value: Release |
| 13 | + - name: DOTNET_CLI_TELEMETRY_OPTOUT |
| 14 | + value: 'true' |
| 15 | + |
| 16 | +blocks: |
| 17 | + - name: 'Linux x64' |
| 18 | + dependencies: [ ] |
| 19 | + task: |
| 20 | + agent: |
| 21 | + machine: |
| 22 | + type: s1-prod-ubuntu20-04-amd64-2 |
| 23 | + jobs: |
| 24 | + - name: 'Build and test' |
| 25 | + commands: |
| 26 | + - dotnet restore |
| 27 | + - make build |
| 28 | + - make test |
| 29 | + - name: 'OSX x64' |
| 30 | + dependencies: [ ] |
| 31 | + task: |
| 32 | + agent: |
| 33 | + machine: |
| 34 | + type: s1-prod-macos |
| 35 | + jobs: |
| 36 | + - name: 'Build and test' |
| 37 | + commands: |
| 38 | + - ulimit -n 1024 |
| 39 | + - dotnet restore |
| 40 | + - make build |
| 41 | + - make test |
| 42 | + - name: 'Windows x64' |
| 43 | + dependencies: [ ] |
| 44 | + task: |
| 45 | + agent: |
| 46 | + machine: |
| 47 | + type: s1-prod-windows |
| 48 | + jobs: |
| 49 | + - name: 'Build and test' |
| 50 | + commands: |
| 51 | + - wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 |
| 52 | + - powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet |
| 53 | + - $Env:Path += ";C:\dotnet" |
| 54 | + - dotnet restore |
| 55 | + - dotnet test -c ${CONFIGURATION} --no-build test/Confluent.Kafka.UnitTests/Confluent.Kafka.UnitTests.csproj |
| 56 | + - dotnet test -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.UnitTests/Confluent.SchemaRegistry.UnitTests.csproj |
| 57 | + - dotnet test -c ${CONFIGURATION} --no-build test/Confluent.SchemaRegistry.Serdes.UnitTests/Confluent.SchemaRegistry.Serdes.UnitTests.csproj |
| 58 | + - name: 'Windows Artifacts on untagged commits' |
| 59 | + run: |
| 60 | + when: "tag !~ '.*'" |
| 61 | + dependencies: |
| 62 | + - 'Windows x64' |
| 63 | + task: |
| 64 | + agent: |
| 65 | + machine: |
| 66 | + type: s1-prod-windows |
| 67 | + jobs: |
| 68 | + - name: 'Build and push artifacts' |
| 69 | + commands: |
| 70 | + - wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 |
| 71 | + - powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet |
| 72 | + - $Env:Path += ";C:\dotnet" |
| 73 | + - dotnet tool update -g docfx |
| 74 | + - dotnet restore |
| 75 | + - dotnet build Confluent.Kafka.sln -c ${Env:CONFIGURATION} |
| 76 | + - dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj -c ${Env:CONFIGURATION} --version-suffix ci-${Env:SEMAPHORE_JOB_ID} --output artifacts |
| 77 | + - dotnet pack src/Confluent.SchemaRegistry/Confluent.SchemaRegistry.csproj -c ${Env:CONFIGURATION} --version-suffix ci-${Env:SEMAPHORE_JOB_ID} --output artifacts |
| 78 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Avro/Confluent.SchemaRegistry.Serdes.Avro.csproj -c ${Env:CONFIGURATION} --version-suffix ci-${Env:SEMAPHORE_JOB_ID} --output artifacts |
| 79 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Protobuf/Confluent.SchemaRegistry.Serdes.Protobuf.csproj -c ${Env:CONFIGURATION} --version-suffix ci-${Env:SEMAPHORE_JOB_ID} --output artifacts |
| 80 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj -c ${Env:CONFIGURATION} --version-suffix ci-${Env:SEMAPHORE_JOB_ID} --output artifacts |
| 81 | + - docfx doc/docfx.json |
| 82 | + - tar.exe -cvzf docs-${Env:SEMAPHORE_JOB_ID}.zip doc/_site/* |
| 83 | + - move docs-${Env:SEMAPHORE_JOB_ID}.zip artifacts |
| 84 | + - artifact push workflow artifacts |
| 85 | + - name: 'Windows Artifacts on tagged commits' |
| 86 | + run: |
| 87 | + when: "tag =~ '.*'" |
| 88 | + dependencies: |
| 89 | + - 'Windows x64' |
| 90 | + task: |
| 91 | + agent: |
| 92 | + machine: |
| 93 | + type: s1-prod-windows |
| 94 | + jobs: |
| 95 | + - name: 'Build and push artifacts' |
| 96 | + commands: |
| 97 | + - wget https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 |
| 98 | + - powershell -ExecutionPolicy ByPass -File dotnet-install.ps1 -Version 6.0.403 -InstallDir C:\dotnet |
| 99 | + - $Env:Path += ";C:\dotnet" |
| 100 | + - dotnet tool update -g docfx |
| 101 | + - dotnet restore |
| 102 | + - dotnet build Confluent.Kafka.sln -c ${Env:CONFIGURATION} |
| 103 | + - dotnet pack src/Confluent.Kafka/Confluent.Kafka.csproj -c ${Env:CONFIGURATION} --output artifacts |
| 104 | + - dotnet pack src/Confluent.SchemaRegistry/Confluent.SchemaRegistry.csproj -c ${Env:CONFIGURATION} --output artifacts |
| 105 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Avro/Confluent.SchemaRegistry.Serdes.Avro.csproj -c ${Env:CONFIGURATION} --output artifacts |
| 106 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Protobuf/Confluent.SchemaRegistry.Serdes.Protobuf.csproj -c ${Env:CONFIGURATION} --output artifacts |
| 107 | + - dotnet pack src/Confluent.SchemaRegistry.Serdes.Json/Confluent.SchemaRegistry.Serdes.Json.csproj -c ${Env:CONFIGURATION} --output artifacts |
| 108 | + - docfx doc/docfx.json |
| 109 | + - tar.exe -cvzf docs-${Env:SEMAPHORE_JOB_ID}.zip doc/_site/* |
| 110 | + - move docs-${Env:SEMAPHORE_JOB_ID}.zip artifacts |
| 111 | + - artifact push workflow artifacts |
| 112 | + |
| 113 | +# TODO: Uncomment the integration tests once they are stable. |
| 114 | +# - name: 'Integration tests' |
| 115 | +# dependencies: [ ] |
| 116 | +# task: |
| 117 | +# agent: |
| 118 | +# machine: |
| 119 | +# type: s1-prod-ubuntu20-04-amd64-2 |
| 120 | +# jobs: |
| 121 | +# - name: 'Build and test' |
| 122 | +# commands: |
| 123 | +# - cd test/docker && docker-compose up -d && cd ../.. |
| 124 | +# - dotnet restore |
| 125 | +# - cd test/Confluent.Kafka.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../.. |
| 126 | +# - name: 'Schema registry and serdes integration tests' |
| 127 | +# dependencies: [ ] |
| 128 | +# task: |
| 129 | +# agent: |
| 130 | +# machine: |
| 131 | +# type: s1-prod-ubuntu20-04-amd64-2 |
| 132 | +# jobs: |
| 133 | +# - name: 'Build and test' |
| 134 | +# commands: |
| 135 | +# - cd test/docker && docker-compose up -d && cd ../.. |
| 136 | +# - dotnet restore |
| 137 | +# - cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../.. |
| 138 | +# - cd test/Confluent.SchemaRegistry.IntegrationTests && dotnet test -l "console;verbosity=normal" && cd ../.. |
0 commit comments