Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI, drop tests for old frameworks, add net7.0 #213

Merged
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-format": {
"version": "5.1.250801",
"commands": [
"dotnet-format"
]
}
}
}
56 changes: 27 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,48 @@ env:
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
# Enforces the consistency of code formatting using `.editorconfig` and the `dotnet-format` tool.
# Enforces the consistency of code formatting using `.editorconfig` and the `dotnet format`.
check-format:
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK v6.0.x
- name: Setup .NET SDK v7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x
# For the time being (https://github.com/dotnet/format/issues/1500, https://github.com/dotnet/format/issues/1560) we need to use `dotnet-format` instead of `dotnet format`
- name: Restore tool
run: dotnet tool restore
- name: Check format
run: dotnet format --verify-no-changes
run: dotnet tool run dotnet-format -- --check

Consul_AspNetCore:
if: github.event_name == 'push' || github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id
strategy:
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
framework: [netcoreapp3.1, net5.0, net6.0]
os: [ubuntu-latest, windows-latest, macos-latest]
framework: [net5.0, net6.0, net7.0]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET Core SDK v3.1.x
if: matrix.framework == 'netcoreapp3.1'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET SDK v5.0.x
if: matrix.framework == 'net5.0'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Setup .NET SDK v6.0.x
if: matrix.framework == 'net6.0'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET SDK v7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build
run: dotnet build Consul.AspNetCore.Test --configuration=Release --framework=${{ matrix.framework }}
- name: Run tests
Expand All @@ -58,32 +61,27 @@ jobs:
strategy:
matrix:
consul: [1.6.10, 1.7.14, 1.8.19, 1.9.17, 1.10.12, 1.11.11, 1.12.9, 1.13.7, 1.14.5, 1.15.1]
framework: [net461, netcoreapp2.1, netcoreapp3.1, net5.0, net6.0]
os: [ubuntu-18.04, windows-2019, macos-10.15]
framework: [net461, net5.0, net6.0, net7.0]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET Core SDK v2.1.x
if: matrix.framework == 'netcoreapp2.1'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 2.1.x
- name: Setup .NET Core SDK v3.1.x
if: matrix.framework == 'netcoreapp3.1'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET SDK v5.0.x
if: matrix.framework == 'net5.0'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Setup .NET SDK v6.0.x
if: matrix.framework == 'net6.0'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET SDK v7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Download Consul
shell: bash
run: |
Expand All @@ -107,15 +105,15 @@ jobs:
path: consul*.log

package:
runs-on: windows-2019
runs-on: windows-latest
needs: [Consul_AspNetCore, Consul]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK v6.0.x
- name: Setup .NET SDK v7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x
- name: Create NuGet packages
run: |
if (-not ("${{ github.ref }}" -like "refs/tags/v*")) {
Expand Down Expand Up @@ -151,7 +149,7 @@ jobs:
publish-preview:
if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/master' }}
needs: package
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Download NuGet package artifacts
uses: actions/download-artifact@v3
Expand All @@ -167,7 +165,7 @@ jobs:
publish-release:
if: ${{ !github.event.repository.fork && startsWith(github.ref, 'refs/tags/v') }}
needs: package
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Download NuGet package artifacts
uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion Consul.AspNetCore.Test/Consul.AspNetCore.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Consul.Test/Consul.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net461;net5.0;net6.0;net7.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<CopyLocalLockFileAssemblies Condition="'$(TargetFramework)' == 'netcoreapp2.1'" >true</CopyLocalLockFileAssemblies>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"version": "7.0.100",
"rollForward": "latestMinor"
}
}