From 6de54f28811774d27c6e09437f6126d4d8f5aacd Mon Sep 17 00:00:00 2001 From: Andreas Mosti Date: Thu, 10 Nov 2022 12:58:09 +0100 Subject: [PATCH] Bumping build image to dotnet 7 (#127) * Bump Microsoft.Extensions.DependencyInjection.Abstractions Bumps [Microsoft.Extensions.DependencyInjection.Abstractions](https://github.com/dotnet/runtime) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits) --- updated-dependencies: - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bumping build image to dotnet 7 * Using env variables to msbuild, as of https://github.com/microsoft/vstest/issues/4014 * Correcting .dockerignore file * Staying at net6.0, bumping dependencies and releasing new patch version * removed comma from TargetFramework Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .dockerignore | 12 ++++++++---- Dockerfile | 11 +++++++++-- README.md | 2 +- .../BikeshareClient.DependencyInjection.csproj | 8 ++++---- .../TestBikeshareClient/TestBikeshareClient.csproj | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9fdb657..79326b9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,8 @@ -bin/ -obj/ -out/ -TestResults/ \ No newline at end of file +# directories +**/bin/ +**/obj/ +**/out/ + +# files +Dockerfile* +**/*.md diff --git a/Dockerfile b/Dockerfile index bc5b11b..b788897 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0.402-bullseye-slim as builder +FROM mcr.microsoft.com/dotnet/sdk:7.0.100-bullseye-slim as builder ARG VERSION_SUFFIX @@ -9,8 +9,15 @@ COPY .git .git COPY src/ . +# MSBuild arguments +ENV CollectCoverage=true +ENV CoverletOutputFormat=opencover +ENV Threshold=80 +ENV ThresholdType=line +ENV ExcludeByAttribute=ExcludeFromCodeCoverageAttribute + RUN dotnet restore BikeshareClient/ -RUN dotnet test BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj /p:CollectCoverage=true /p:Threshold=80 /p:ThresholdType=line /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=ExcludeFromCodeCoverageAttribute +RUN dotnet test BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj RUN dotnet pack BikeshareClient/ -c Release -o output $VERSION_SUFFIX diff --git a/README.md b/README.md index a7ef886..08e42f4 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ services.AddBikeshareClient("http://gbfs.urbansharing.com/trondheim/gbfs.json"); Simple build: ```bash -docker run --rm -it -v $(pwd):/app mcr.microsoft.com/dotnet/sdk:6.0 dotnet pack app/src/BikeshareClient -o /app +docker run --rm -it -v $(pwd):/app mcr.microsoft.com/dotnet/sdk:7.0 dotnet pack app/src/BikeshareClient -o /app ``` Run test script: diff --git a/src/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection.csproj b/src/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection.csproj index c3e9202..a8ce958 100644 --- a/src/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection.csproj +++ b/src/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection/BikeshareClient.DependencyInjection.csproj @@ -3,8 +3,8 @@ net6.0 enable enable - 3.3.5 - 3.3.5 + 3.3.6 + 3.3.6 BikeshareClient.DependencyInjection andmos @@ -19,7 +19,7 @@ - - + + diff --git a/src/BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj b/src/BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj index d49d15f..a4add0d 100644 --- a/src/BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj +++ b/src/BikeshareClient/TestBikeshareClient/TestBikeshareClient.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 false 1.0.1