Skip to content

Commit d3969e4

Browse files
authored
Install .NET with mise and use .NET 8 in examples (#2510)
1 parent cd71180 commit d3969e4

File tree

27 files changed

+43
-53
lines changed

27 files changed

+43
-53
lines changed

.semaphore/semaphore.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ blocks:
2323
jobs:
2424
- name: 'Build and test'
2525
commands:
26-
# TODO: install .NET 8.0 SDK in this agent image
27-
- sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard* -y
28-
# TODO: remove incorrect focal repos from this agent
29-
- sudo rm /etc/apt/sources.list.d/*microsoft*
30-
- sudo apt update && sudo apt install -y dotnet-sdk-6.0 dotnet-sdk-8.0
31-
- dotnet tool install --global dotnet-coverage
26+
- mise use dotnet@6
27+
- mise use dotnet@8
28+
- dotnet tool install --tool-path $PWD dotnet-coverage
3229
- dotnet restore
3330
- make build
34-
- make test-coverage
35-
- dotnet-coverage merge test/**/coverage.xml -o unit-coverage.xml -f xml
31+
- make test-coverage DOTNET_COVERAGE_TOOL=$PWD/dotnet-coverage
32+
- ./dotnet-coverage merge test/**/coverage.xml -o unit-coverage.xml -f xml
3633
- artifact push workflow unit-coverage.xml || true
3734
- name: 'OSX x64'
3835
dependencies: [ ]
@@ -138,12 +135,9 @@ blocks:
138135
prologue:
139136
commands:
140137
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
141-
# TODO: install .NET 8.0 SDK in this agent image
142-
- sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard* -y
143-
# TODO: remove incorrect focal repos from this agent
144-
- sudo rm /etc/apt/sources.list.d/*microsoft*
145-
- sudo apt update && sudo apt install -y dotnet-sdk-8.0
146-
- dotnet tool install --global dotnet-coverage
138+
- mise use dotnet@8
139+
- dotnet tool install --tool-path $PWD dotnet-coverage
140+
- export DOTNET_COVERAGE_TOOL=$PWD/dotnet-coverage
147141
jobs:
148142
- name: 'Build documentation'
149143
commands:
@@ -154,7 +148,7 @@ blocks:
154148
- cd test/docker && docker-compose up -d && sleep 30 && cd ../..
155149
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
156150
- dotnet restore -p:TargetFramework=net8.0
157-
- cd test/Confluent.Kafka.IntegrationTests && dotnet-coverage collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../classic-coverage.xml && cd ../..
151+
- cd test/Confluent.Kafka.IntegrationTests && $DOTNET_COVERAGE_TOOL collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../classic-coverage.xml && cd ../..
158152
- artifact push workflow classic-coverage.xml || true
159153
- name: 'Build and test with "consumer" protocol'
160154
commands:
@@ -163,15 +157,15 @@ blocks:
163157
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
164158
- export TEST_CONSUMER_GROUP_PROTOCOL=consumer
165159
- dotnet restore -p:TargetFramework=net8.0
166-
- cd test/Confluent.Kafka.IntegrationTests && dotnet-coverage collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../consumer-coverage.xml && cd ../..
160+
- cd test/Confluent.Kafka.IntegrationTests && $DOTNET_COVERAGE_TOOL collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../consumer-coverage.xml && cd ../..
167161
- artifact push workflow consumer-coverage.xml || true
168162
- name: 'Schema registry and serdes integration tests'
169163
commands:
170164
- cd test/docker && docker-compose up -d && cd ../..
171165
- export SEMAPHORE_SKIP_FLAKY_TESTS='true'
172166
- dotnet restore -p:TargetFramework=net8.0
173-
- cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && dotnet-coverage collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../sr-target/serdes-coverage.xml && cd ../..
174-
- cd test/Confluent.SchemaRegistry.IntegrationTests && dotnet-coverage collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../sr-target/coverage.xml && cd ../..
167+
- cd test/Confluent.SchemaRegistry.Serdes.IntegrationTests && $DOTNET_COVERAGE_TOOL collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../sr-target/serdes-coverage.xml && cd ../..
168+
- cd test/Confluent.SchemaRegistry.IntegrationTests && $DOTNET_COVERAGE_TOOL collect 'dotnet test -f net8.0 -l "console;verbosity=normal"' -f xml -o ../../sr-target/coverage.xml && cd ../..
175169
- artifact push workflow sr-target || true
176170

177171
after_pipeline:
@@ -184,15 +178,11 @@ after_pipeline:
184178
commands:
185179
- checkout
186180
- sem-version java 11
187-
# TODO: install .NET 8.0 SDK in this agent image
188-
- sudo apt remove dotnet-sdk* dotnet-host* dotnet* aspnetcore* netstandard* -y
189-
# TODO: remove incorrect focal repos from this agent
190-
- sudo rm /etc/apt/sources.list.d/*microsoft*
191-
- sudo apt update && sudo apt install -y dotnet-sdk-8.0
192-
- dotnet tool install --global dotnet-coverage
181+
- mise use dotnet@8
182+
- dotnet tool install --tool-path $PWD dotnet-coverage
193183
- artifact pull workflow unit-coverage.xml || true
194184
- artifact pull workflow classic-coverage.xml || true
195185
- artifact pull workflow consumer-coverage.xml || true
196186
- artifact pull workflow sr-target || true
197-
- dotnet-coverage merge *coverage.xml **/*coverage.xml -o coverage.xml -f xml --remove-input-files
187+
- ./dotnet-coverage merge *coverage.xml **/*coverage.xml -o coverage.xml -f xml --remove-input-files
198188
- emit-sonarqube-data --run_only_sonar_scan

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
OS=$(shell uname -s)
88

99
EXAMPLE_DIRS=$(shell find ./examples -name '*.csproj' -exec dirname {} \;)
10-
TEST_DIRS=$(shell find ./test -name '*.csproj' \;)
10+
TEST_DIRS=$(shell find ./test -name '*.csproj' -exec dirname {} \;)
1111
UNIT_TEST_DIRS=$(shell find . -type d -regex '.*UnitTests$$' -exec basename {} \;)
1212

1313
# We want to run tests by default with latest version of .NET
@@ -30,7 +30,7 @@ test:
3030

3131
test-coverage:
3232
@(for d in $(UNIT_TEST_DIRS) ; do \
33-
dotnet-coverage collect "dotnet test test/$$d/$$d.csproj" \
33+
$(DOTNET_COVERAGE_TOOL) collect "dotnet test -f $(DEFAULT_TEST_FRAMEWORK) test/$$d/$$d.csproj" \
3434
-f xml -o test/$$d/coverage.xml ; \
3535
done)
3636

examples/AdminClient/AdminClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AdminClient</AssemblyName>
6-
<TargetFramework>net6.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
<OutputType>Exe</OutputType>
88
<LangVersion>7.3</LangVersion>
99
</PropertyGroup>

examples/AvroBlogExamples/AvroBlogExamples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<OutputType>Exe</OutputType>
6-
<TargetFramework>net6.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
<LangVersion>7.1</LangVersion>
88
</PropertyGroup>
99

examples/AvroGeneric/AvroGeneric.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AvroGeneric</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<LangVersion>7.1</LangVersion>
99
</PropertyGroup>
1010

examples/AvroGenericEncryption/AvroGenericEncryption.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AvroGenericEncryption</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<LangVersion>7.1</LangVersion>
99
</PropertyGroup>
1010

examples/AvroGenericMigration/AvroGenericMigration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AvroGenericMigration</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<LangVersion>7.1</LangVersion>
99
</PropertyGroup>
1010

examples/AvroSpecific/AvroSpecific.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AvroSpecific</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<LangVersion>7.1</LangVersion>
99
</PropertyGroup>
1010

examples/AvroSpecificEncryption/AvroSpecificEncryption.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>AvroSpecificEncryption</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<TargetFramework>net6.0</TargetFramework>
7+
<TargetFramework>net8.0</TargetFramework>
88
<LangVersion>7.1</LangVersion>
99
</PropertyGroup>
1010

examples/Configuration/Configuration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
55
<AssemblyName>Configuration</AssemblyName>
6-
<TargetFramework>net6.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
<OutputType>Exe</OutputType>
88
</PropertyGroup>
99

0 commit comments

Comments
 (0)