Skip to content

Commit

Permalink
build and test with .net 8 (#242)
Browse files Browse the repository at this point in the history
* feat: build and test with .net 8

* fix: run fake though fsi

* fix: workflow

* fix: kill build.fsx.lock file

* fix: checkout code 😂

* hk: update release notes
  • Loading branch information
sergey-tihon authored Mar 14, 2024
1 parent a11e58b commit 4339238
Show file tree
Hide file tree
Showing 16 changed files with 98 additions and 309 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet: [6.0.413]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET 8.0 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
dotnet-version: '8.0.x'
- name: Install local tools
run: dotnet tool restore
- name: Paket Restore
run: dotnet paket restore
- name: Build and Test
run: dotnet fake run build.fsx
run: dotnet fsi build.fsx
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
dotnet tool restore
dotnet paket restore
dotnet fake run build.fsx %*
dotnet fsi build.fsx %*
41 changes: 22 additions & 19 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#r @"paket:
source https://nuget.org/api/v2
framework net6.0
nuget FSharp.Core 6.0.0.0
nuget Fake.Core.Target
nuget Fake.Core.Process
nuget Fake.Core.ReleaseNotes
nuget Fake.IO.FileSystem
nuget Fake.DotNet.Cli
nuget Fake.DotNet.MSBuild
nuget Fake.DotNet.AssemblyInfoFile
nuget Fake.DotNet.Paket
nuget Fake.DotNet.FSFormatting
nuget Fake.Tools.Git
nuget Fake.Api.GitHub //"
#load "./.fake/build.fsx/intellisense.fsx"
#r "nuget: Fake.Core.Target"
#r "nuget: Fake.Core.Process"
#r "nuget: Fake.Core.ReleaseNotes"
#r "nuget: Fake.IO.FileSystem"
#r "nuget: Fake.DotNet.Cli"
#r "nuget: Fake.DotNet.MSBuild"
#r "nuget: Fake.DotNet.AssemblyInfoFile"
#r "nuget: Fake.DotNet.Paket"
#r "nuget: Fake.DotNet.FSFormatting"
#r "nuget: Fake.Tools.Git"
#r "nuget: Fake.Api.GitHub"

// Boilerplate - https://github.com/fsprojects/FAKE/issues/2719#issuecomment-1470687052
System.Environment.GetCommandLineArgs()
|> Array.skip 2 // skip fsi.exe; build.fsx
|> Array.toList
|> Fake.Core.Context.FakeExecutionContext.Create false __SOURCE_FILE__
|> Fake.Core.Context.RuntimeContext.Fake
|> Fake.Core.Context.setExecutionContext

open Fake
open Fake.Core.TargetOperators
Expand Down Expand Up @@ -88,7 +91,7 @@ let webApiInputStream = StreamRef.Empty
Target.create "StartServer" (fun _ ->
Target.activateFinal "StopServer"

CreateProcess.fromRawCommandLine "dotnet" "tests/Swashbuckle.WebApi.Server/bin/Release/net6.0/Swashbuckle.WebApi.Server.dll"
CreateProcess.fromRawCommandLine "dotnet" "tests/Swashbuckle.WebApi.Server/bin/Release/net8.0/Swashbuckle.WebApi.Server.dll"
|> CreateProcess.withStandardInput(CreatePipe webApiInputStream)
|> Proc.start
|> ignore
Expand All @@ -113,9 +116,9 @@ Target.create "BuildTests" (fun _ -> dotnet "build" "SwaggerProvider.TestsAndDoc
let runTests assembly =
dotnet "test" $"{assembly} -c Release --no-build"

Target.create "RunUnitTests" (fun _ -> runTests "tests/SwaggerProvider.Tests/bin/Release/net6.0/SwaggerProvider.Tests.dll")
Target.create "RunUnitTests" (fun _ -> runTests "tests/SwaggerProvider.Tests/bin/Release/net8.0/SwaggerProvider.Tests.dll")

Target.create "RunIntegrationTests" (fun _ -> runTests "tests/SwaggerProvider.ProviderTests/bin/Release/net6.0/SwaggerProvider.ProviderTests.dll")
Target.create "RunIntegrationTests" (fun _ -> runTests "tests/SwaggerProvider.ProviderTests/bin/Release/net8.0/SwaggerProvider.ProviderTests.dll")

Target.create "RunTests" ignore

Expand Down
193 changes: 0 additions & 193 deletions build.fsx.lock

This file was deleted.

4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ then
else
dotnet tool restore
dotnet paket restore
dotnet fake run build.fsx $@
fi
dotnet fsi build.fsx $@
fi
3 changes: 3 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.1.0 - Mar 14, 2024
- Build and test with .NET 8.0

#### 2.0.1 - Mar 12, 2024
- fix: update ProvidedTypes.fs (#235)
- FSharp.Data utilities update (#238)
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.413",
"version": "8.0.201",
"rollForward": "minor"
}
}
11 changes: 4 additions & 7 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
version 7.2.1
version 8.0.3
source https://api.nuget.org/v3/index.json
frameworks: net6.0, netstandard2.0
frameworks: net8.0, netstandard2.0

nuget FSharp.Core ~> 6 // We need task{} CE from F# 6.0
nuget System.Text.Json ~> 6
nuget FSharp.SystemTextJson
nuget Microsoft.OpenApi.Readers
nuget NETStandard.Library.NETFramework

nuget System.Text.Encodings.Web ~> 6
nuget Microsoft.Bcl.AsyncInterfaces ~> 6

# delete when we drop custom parser for v2
nuget YamlDotNet

Expand All @@ -23,7 +20,7 @@ github fsprojects/FSharp.Data:main src/FSharp.Data.Runtime.Utilities/NameUtils.f

group Server
source https://api.nuget.org/v3/index.json
framework: net6.0
framework: net8.0

nuget Microsoft.AspNetCore
nuget Microsoft.AspNetCore.Mvc
Expand All @@ -34,7 +31,7 @@ group Server

group Test
source https://api.nuget.org/v3/index.json
frameworks: net6.0
frameworks: net8.0

nuget FSharp.Compiler.Service
nuget FSharp.Core
Expand Down
Loading

0 comments on commit 4339238

Please sign in to comment.