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

Run build and tests in net8.0 #179

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
"version": "7.2.1",
"version": "8.0.3",
"commands": [
"paket"
]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.102'
dotnet-version: '8.0.101'
include-prerelease: true

- name: NuGet cache
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: nuget
path: bin/nuget
path: artifacts/nuget

prerelease:
runs-on: ubuntu-latest
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.102'
dotnet-version: '8.0.101'
include-prerelease: true

- name: Download nupkg
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.102'
dotnet-version: '8.0.101'
include-prerelease: true

- name: Prepare
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ paket-files/
.vscode
*.user
.idea/
artifacts/
997 changes: 500 additions & 497 deletions .paket/Paket.Restore.targets

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts\</ArtifactsPath>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

<PropertyGroup>
<_DotnetToolManifestFile>$(MSBuildThisFileDirectory).config\dotnet-tools.json</_DotnetToolManifestFile>
<_DotnetToolRestoreOutputFile>$(MSBuildThisFileDirectory)build\obj\dotnet-tool-restore-$(NETCoreSdkVersion)</_DotnetToolRestoreOutputFile>
<_DotnetToolRestoreOutputFile>$(ArtifactsPath)dotnet-tool-restore-$(NETCoreSdkVersion)</_DotnetToolRestoreOutputFile>
</PropertyGroup>

<!-- Make sure that dotnet tools (including paket) are restored before restoring any project -->
<Target Name="ToolRestore" BeforeTargets="Restore;CollectPackageReferences" Inputs="$(_DotnetToolManifestFile)" Outputs="$(_DotnetToolRestoreOutputFile)">
<Exec Command="dotnet tool restore" WorkingDirectory="$(MSBuildThisFileDirectory)" StandardOutputImportance="High" StandardErrorImportance="High" />
<MakeDir Directories="$(ArtifactsPath)"/>
<Touch Files="$(_DotnetToolRestoreOutputFile)" AlwaysCreate="True" ForceTouch="True" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
4 changes: 4 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env pwsh

if ($env:GITHUB_ACTION) {
echo "::group::Build FAKE project"
}

dotnet run -v:m --project build $args
32 changes: 23 additions & 9 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,34 @@ module Paths =
let root = Path.getDirectory __SOURCE_DIRECTORY__
let sln = root </> "FSharp.SystemTextJson.sln"
let src = root </> "src" </> "FSharp.SystemTextJson"
let out = root </> "bin"
let nugetOut = out </> "nuget"
let artifacts = root </> "artifacts"
let nugetOut = artifacts </> "nuget"
let test = root </> "tests" </> "FSharp.SystemTextJson.Tests"
let benchmarks = root </> "benchmarks" </> "FSharp.SystemTextJson.Benchmarks"
let trimTest = root </> "tests" </> "FSharp.SystemTextJson.TrimTest"

let trimTestOut rti =
trimTest
</> "bin"
</> "Release"
</> "net7.0"
</> rti
artifacts
</> "publish"
</> "FSharp.SystemTextJson.TrimTest"
</> $"release_%s{rti}"
</> "FSharp.SystemTextJson.TrimTest.dll"

Target.create "Clean" (fun _ -> !! "**/bin" ++ "**/obj" |> Shell.cleanDirs)
module Target =

let create name action =
Target.create name
<| fun o ->
if BuildServer.isGitHubActionsBuild then
try
printfn $"::group::{name}"
action o
finally
printfn "::endgroup::"
else
action o

Target.create "Clean" (fun _ -> !! "artifacts" |> Shell.cleanDirs)

Target.create "Build" (fun _ -> DotNet.build id Paths.sln)

Expand All @@ -71,7 +83,7 @@ Target.create
{ o with
Configuration = DotNet.BuildConfiguration.Release
Logger = Some "trx"
ResultsDirectory = Some Paths.out }
ResultsDirectory = Some Paths.artifacts }
)
Paths.test
)
Expand Down Expand Up @@ -103,4 +115,6 @@ Target.create "All" ignore
"Pack" <== [ "Build" ]
"Build" <== [ if Cli.clean then "Clean" ]


if BuildServer.isGitHubActionsBuild then printfn "::endgroup::"
Target.runOrDefaultWithArguments "All"
2 changes: 1 addition & 1 deletion build/build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="build.fs" />
Expand Down
23 changes: 11 additions & 12 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,33 @@ nuget Nerdbank.GitVersioning copy_local:true
nuget System.Text.Json >= 6.0 lowest_matching: true

group test
framework net7.0
framework net8.0
storage none
source https://api.nuget.org/v3/index.json

nuget FSharp.Core >= 5.0
nuget FsCheck.XUnit
nuget Microsoft.NET.Test.Sdk ~> 16.3.0
nuget Microsoft.NET.Test.Sdk
nuget System.Text.Json >= 8.0 prerelease
nuget xunit ~> 2.4.0
nuget xunit.runner.visualstudio ~> 2.4.0
nuget xunit
nuget xunit.runner.visualstudio
nuget BenchmarkDotNet
nuget Newtonsoft.Json

group trimtest
framework net7.0
framework net8.0
storage none
source https://api.nuget.org/v3/index.json

nuget FSharp.Core >= 5.0
nuget System.Text.Json >= 6.0
nuget FSharp.Core
nuget System.Text.Json
nuget FsCheck.XUnit
nuget xunit ~> 2.4.0
nuget xunit.console ~> 2.4.0
nuget xunit.extensibility.execution ~> 2.4.0 copy_content_to_output_dir: always, copy_local: true
nuget Microsoft.NET.Test.Sdk ~> 16.3.0
nuget xunit
nuget xunit.console
nuget Microsoft.NET.Test.Sdk

group fake
framework net7.0
framework net8.0
storage none
source https://api.nuget.org/v3/index.json

Expand Down
Loading
Loading