Skip to content

Commit

Permalink
Add .NET 9 as target framework, fine-tune dependabot, update CI and c…
Browse files Browse the repository at this point in the history
…lean tests removing .NET 6/7 from target frameworks (#639)

* add .NET 9 as target framework

* run fantomas-check using ubuntu-latest

* change build-and-test trigger to run when pushing to master branch

* update dependabot setup to scan src/ and tests/ folder

* clean tests and remove .net 6 and 7
  • Loading branch information
64J0 authored Jan 20, 2025
1 parent 593f559 commit 914a5ce
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
9 changes: 6 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ updates:
schedule:
interval: "weekly"

# Maintain dependencies for nuget
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference#directories-or-directory--
- package-ecosystem: "nuget"
directory: "/"
directories:
- "/"
- "/src/Giraffe/"
- "/tests/Giraffe.Tests/"
schedule:
interval: "weekly"
interval: "weekly"
7 changes: 5 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and test

on:
push:
branches:
- master
pull_request:

env:
Expand Down Expand Up @@ -33,6 +35,7 @@ jobs:
6.x
7.x
8.x
9.x
- name: Restore
run: dotnet restore
- name: Build
Expand All @@ -48,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Restore tools
run: dotnet tool restore
- name: Build solution
Expand All @@ -64,4 +67,4 @@ jobs:
uses: github/codeql-action/upload-sarif@v3
with:
# You can also specify the path to a folder for `sarif_file`
sarif_file: ./src/Giraffe/analysis.sarif
sarif_file: ./src/Giraffe/analysis.sarif
4 changes: 2 additions & 2 deletions .github/workflows/fantomas-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
fantomas-check:
name: Code format check
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -24,4 +24,4 @@ jobs:
run: dotnet fantomas --check src samples tests
- name: log failure
if: failure()
run: echo "Some files need formatting, please run 'dotnet fantomas src samples tests'"
run: echo "Some files need formatting, please run 'dotnet fantomas src samples tests'"
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
6.x
7.x
8.x
9.x
- name: Restore
run: dotnet restore
- name: Build
Expand All @@ -57,6 +58,7 @@ jobs:
6.x
7.x
8.x
9.x
- name: Create Release NuGet package
run: |
arrTag=(${GITHUB_REF//\// })
Expand All @@ -75,4 +77,4 @@ jobs:
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED
done
- name: Push to NuGet Feed
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY
2 changes: 1 addition & 1 deletion src/Giraffe/Giraffe.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<NeutralLanguage>en-GB</NeutralLanguage>

<!-- Build settings -->
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<DebugType>portable</DebugType>
<OutputType>Library</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
29 changes: 11 additions & 18 deletions tests/Giraffe.Tests/Giraffe.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AssemblyName>Giraffe.Tests</AssemblyName>
</PropertyGroup>

Expand Down Expand Up @@ -34,29 +34,22 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.*" />
</ItemGroup>


<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.*" />
</ItemGroup>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.*" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.*" />
<PackageReference Include="System.Net.Http" Version="4.3.*" />
<PackageReference Include="xunit" Version="2.7.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.*">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.*" />
<PackageReference Include="xunit" Version="2.9.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.*" />
<PackageReference Include="NSubstitute" Version="5.3.*" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 914a5ce

Please sign in to comment.