Skip to content

Commit

Permalink
Upgrade tests and build to net7 except for Fable (net6) (#525)
Browse files Browse the repository at this point in the history

Co-authored-by: Tiago Rodrigues <tiagomcrodrigues@gmail.com>
Co-authored-by: gusty <1261319+gusty@users.noreply.github.com>
Co-authored-by: Oskar Gewalli <wallymathieu@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 27, 2022
1 parent 3caa9d1 commit 80616e3
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 56 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
dotnet-version: 7.0.100
- name: Restore
run: git submodule update --init --recursive
- name: Build with dotnet
Expand All @@ -38,7 +38,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
Expand Down Expand Up @@ -78,6 +82,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.100
- name: Setup .NET Core 6
uses: actions/setup-dotnet@v1
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/fable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Restore
run: git submodule update --init --recursive
- name: Remove global json
run: rm global.json
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Restore
run: git submodule update --init --recursive
- name: Restore tools
run: dotnet tool restore
- name: Use Node.js
Expand All @@ -37,12 +39,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Restore
run: git submodule update --init --recursive
- name: Remove global json
run: rm global.json
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Restore
run: git submodule update --init --recursive
- name: Restore tools
run: dotnet tool restore
# - name: Run tests (Fable2 subset but on .net)
Expand Down
2 changes: 1 addition & 1 deletion docsrc/tools/docsTool.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"sdk": {
"version": "6.0.200",
"version": "7.0.100",
"rollForward": "latestFeature"
},

"additionalSdks": [
"5.0.405"
"5.0.405",
"6.0.201"
]
}
2 changes: 1 addition & 1 deletion src/FSharpPlus.Docs/FSharpPlus.Docs.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable</Configurations>
<Platforms>AnyCPU</Platforms>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/FSharpPlus/Control/Numeric.fs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,15 @@ type TryNegate' =
type DivRem =
inherit Default1
static member inline DivRem (x: ^t when ^t: null and ^t: struct, y: ^t, _thisClass: DivRem) = (x, y)
static member inline DivRem (D: 'T, d: 'T, [<Optional>]_impl: Default1) = let q = D / d in q, D - q * d
static member inline DivRem (D: 'T, d: 'T, [<Optional>]_impl: DivRem ) =
static member inline DivRem (D: 'T, d: 'T, _impl: Default2) = let q = D / d in q, D - q * d
static member inline DivRem (D: 'T, d: 'T, _impl: Default1) =
let mutable r = Unchecked.defaultof<'T>
(^T: (static member DivRem : _ * _ -> _ -> _) (D, d, &r)), r

static member inline DivRem (D: 'T, d: 'T, _impl: DivRem ) =
let (struct (x, y)) = (^T: (static member DivRem : _ * _ -> _) (D, d))
(x, y)

static member inline Invoke (D: 'T) (d: 'T) : 'T*'T =
let inline call_3 (a: ^a, b: ^b, c: ^c) = ((^a or ^b or ^c) : (static member DivRem : _*_*_ -> _) b, c, a)
let inline call (a: 'a, b: 'b, c: 'c) = call_3 (a, b, c)
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharpPlus.Tests/FSharpPlus.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<FscToolExe>$(FSC_ExePathCompilerBuild)</FscToolExe>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;Fable</Configurations>
<Platforms>AnyCPU</Platforms>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Helpers.fs" />
Expand Down
84 changes: 42 additions & 42 deletions tests/FSharpPlusFable.Tests/FSharpPlusFable.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable;Fable3</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_FAKE</DefineConstants>
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3;FABLE_COMPILER_FAKE</DefineConstants>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<Configurations>Debug;Release;Fable;Fable3</Configurations>
<Platforms>AnyCPU</Platforms>
<LangVersion Condition=" '$(Configuration)' == 'Fable' OR '$(Configuration)' == 'Fable3' ">6.0</LangVersion>
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_FAKE</DefineConstants>
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3;FABLE_COMPILER_FAKE</DefineConstants>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="FSharpTests/General/Util.fs" />
<Compile Include="FSharpTests/General/Splits.fs" />
<Compile Include="FSharpTests/General/MonoidCompile.fs" />
<Compile Include="FSharpTests/General/Monoid.fs" />
<Compile Include="FSharpTests/General/Functor.fs" />
<Compile Include="FSharpTests/General/Collections.fs" />
<Compile Include="FSharpTests/General/Monad.fs" />
<Compile Include="FSharpTests/General/Applicative.fs" />
<Compile Include="FSharpTests/General/Alternative.fs" />
<Compile Include="FSharpTests/General/Foldable.fs" />
<Compile Include="FSharpTests/General/Indexable.fs" />
<Compile Include="FSharpTests/General/Parsing.fs" />
<Compile Include="FSharpTests/General/Traversable.fs" />
<Compile Include="FSharpTests/General/Lensing.fs" />
<Compile Include="FSharpTests/General/Numeric.fs" />
<Compile Include="FSharpTests/General.fs" />
<Compile Include="FSharpTests/Extensions.fs" />
<Compile Include="Tests.fs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="FSharpTests/General/Util.fs" />
<Compile Include="FSharpTests/General/Splits.fs" />
<Compile Include="FSharpTests/General/MonoidCompile.fs" />
<Compile Include="FSharpTests/General/Monoid.fs" />
<Compile Include="FSharpTests/General/Functor.fs" />
<Compile Include="FSharpTests/General/Collections.fs" />
<Compile Include="FSharpTests/General/Monad.fs" />
<Compile Include="FSharpTests/General/Applicative.fs" />
<Compile Include="FSharpTests/General/Alternative.fs" />
<Compile Include="FSharpTests/General/Foldable.fs" />
<Compile Include="FSharpTests/General/Indexable.fs" />
<Compile Include="FSharpTests/General/Parsing.fs" />
<Compile Include="FSharpTests/General/Traversable.fs" />
<Compile Include="FSharpTests/General/Lensing.fs" />
<Compile Include="FSharpTests/General/Numeric.fs" />
<Compile Include="FSharpTests/General.fs" />
<Compile Include="FSharpTests/Extensions.fs" />
<Compile Include="Tests.fs" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Fable.Core" Version="3.2.5" />
<PackageReference Include="Fable.Promise" Version="2.2.0" />
<PackageReference Include="Fable.Fetch" Version="2.2.0" />
<PackageReference Include="Fuchu" Version="1.2.0-beta-1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Core" Version="3.2.5" />
<PackageReference Include="Fable.Promise" Version="2.2.0" />
<PackageReference Include="Fable.Fetch" Version="2.2.0" />
<PackageReference Include="Fuchu" Version="1.2.0-beta-1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\FSharpPlus\FSharpPlus.fsproj">
<Private>True</Private>
</ProjectReference>
<PackageReference Update="FSharp.Core" Version="6.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\FSharpPlus\FSharpPlus.fsproj">
<Private>True</Private>
</ProjectReference>
<PackageReference Update="FSharp.Core" Version="6.0.6" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions tests/FSharpPlusFable.Tests/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.201",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion tests/benchmarks/Benchmarks.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize>
Expand Down

0 comments on commit 80616e3

Please sign in to comment.