Skip to content

Commit

Permalink
Update ci to net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Feb 17, 2024
1 parent 46cbc97 commit 80cd768
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 37 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Install .NET 7.0
uses: actions/setup-dotnet@v3
- name: Install .NET 7.0 and 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
7.0
8.0
- name: Build, Test, Pack, Publish
shell: bash
Expand Down
1 change: 0 additions & 1 deletion src/Consolus.Tests/ConsoleTextTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.IO;
using NUnit.Framework;

namespace Consolus.Tests
{
Expand Down
15 changes: 11 additions & 4 deletions src/Consolus.Tests/Consolus.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />

<Using Include="NUnit.Framework" />
<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />
<Using Include="NUnit.Framework.Legacy.CollectionAssert" Alias="CollectionAssert" />
<Using Include="NUnit.Framework.Legacy.StringAssert" Alias="StringAssert" />
<Using Include="NUnit.Framework.Legacy.DirectoryAssert" Alias="DirectoryAssert" />
<Using Include="NUnit.Framework.Legacy.FileAssert" Alias="FileAssert" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Kalk.CodeGen/Kalk.CodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Broslyn" Version="1.2.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.1" />
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.7.1" />
<PackageReference Include="Scriban" Version="5.9.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Kalk.Core/Kalk.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="CsvHelper" Version="31.0.0" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
<PackageReference Include="System.Runtime.Numerics" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="Scriban" Version="5.9.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Kalk.Core/Model/KalkComplex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public override string ToString()

public Span<byte> AsSpan()
{
return MemoryMarshal.CreateSpan(ref Unsafe.As<KalkComplex, byte>(ref Unsafe.AsRef(this)), Unsafe.SizeOf<KalkComplex>());
return MemoryMarshal.CreateSpan(ref Unsafe.As<KalkComplex, byte>(ref Unsafe.AsRef(in this)), Unsafe.SizeOf<KalkComplex>());
}

public bool TryConvertTo(TemplateContext context, SourceSpan span, Type type, out object value)
Expand Down
4 changes: 2 additions & 2 deletions src/Kalk.Core/Model/KalkHalf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void Display(KalkEngine engine, KalkDisplayMode mode)

private void DisplayDetailed(KalkEngine engine)
{
var u16 = Unsafe.As<Half, ushort>(ref Unsafe.AsRef(_value));
var u16 = Unsafe.As<Half, ushort>(ref Unsafe.AsRef(in _value));
engine.WriteHighlightLine($" # IEEE 754 - half float - 16-bit");
engine.WriteHighlightLine($" #");
engine.WriteInt16(u16, true);
Expand Down Expand Up @@ -156,7 +156,7 @@ public string ToString(string? format, IFormatProvider? formatProvider)

public Span<byte> AsSpan()
{
return MemoryMarshal.CreateSpan(ref Unsafe.As<KalkHalf, byte>(ref Unsafe.AsRef(this)), Unsafe.SizeOf<KalkHalf>());
return MemoryMarshal.CreateSpan(ref Unsafe.As<KalkHalf, byte>(ref Unsafe.AsRef(in this)), Unsafe.SizeOf<KalkHalf>());
}

public bool TryConvertTo(TemplateContext context, SourceSpan span, Type type, out object value)
Expand Down
2 changes: 1 addition & 1 deletion src/Kalk.Core/Model/KalkNativeBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public KalkNativeBuffer(byte[] buffer)
public static KalkNativeBuffer AsBytes<T>(int byteCount, in T element)
{
var buffer = new KalkNativeBuffer(byteCount);
Unsafe.CopyBlockUnaligned(ref buffer.AsSpan()[0], ref Unsafe.As<T, byte>(ref Unsafe.AsRef(element)), (uint)byteCount);
Unsafe.CopyBlockUnaligned(ref buffer.AsSpan()[0], ref Unsafe.As<T, byte>(ref Unsafe.AsRef(in element)), (uint)byteCount);
return buffer;
}

Expand Down
16 changes: 8 additions & 8 deletions src/Kalk.Core/Modules/MiscModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ private static string HexaFromBytes<T>(int byteCount, in T element, bool prefix,
for (int i = 0; i < byteCount; i++)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, byte>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, byte>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix && (i % 1) == 0) builder.Append("0x");
builder.Append(v.ToString("X2"));
}
Expand All @@ -1521,7 +1521,7 @@ private static string HexaFromBytes<T>(int byteCount, in T element, bool prefix,
for (int i = 0; i < byteCount; i += 2)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, short>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, short>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix && (i % 2) == 0) builder.Append("0x");
builder.Append(v.ToString("X2"));
}
Expand All @@ -1531,7 +1531,7 @@ private static string HexaFromBytes<T>(int byteCount, in T element, bool prefix,
for (int i = 0; i < byteCount; i += 4)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, int>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, int>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix && (i % 4) == 0) builder.Append("0x");
builder.Append(v.ToString("X2"));
}
Expand All @@ -1541,7 +1541,7 @@ private static string HexaFromBytes<T>(int byteCount, in T element, bool prefix,
for (int i = 0; i < byteCount; i += 8)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, long>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, long>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix && (i % 8) == 0) builder.Append("0x");
builder.Append(v.ToString("X2"));
}
Expand Down Expand Up @@ -1762,7 +1762,7 @@ private static string BinaryFromBytes<T>(int byteCount, in T element, bool prefi
for (int i = 0; i < byteCount; i++)
{
if (i > 0) builder.Append(separator);
var b = Unsafe.As<T, byte>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var b = Unsafe.As<T, byte>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix) builder.Append("0b");
AppendBinary(builder, b);
}
Expand All @@ -1772,7 +1772,7 @@ private static string BinaryFromBytes<T>(int byteCount, in T element, bool prefi
for (int i = 0; i < byteCount; i += 2)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, short>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, short>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix) builder.Append("0b");
AppendBinary(builder, v);
}
Expand All @@ -1782,7 +1782,7 @@ private static string BinaryFromBytes<T>(int byteCount, in T element, bool prefi
for (int i = 0; i < byteCount; i += 4)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, int>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, int>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix) builder.Append("0b");
AppendBinary(builder, v);
}
Expand All @@ -1792,7 +1792,7 @@ private static string BinaryFromBytes<T>(int byteCount, in T element, bool prefi
for (int i = 0; i < byteCount; i += 8)
{
if (i > 0) builder.Append(separator);
var v = Unsafe.As<T, long>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(element), new IntPtr(i)));
var v = Unsafe.As<T, long>(ref Unsafe.AddByteOffset(ref Unsafe.AsRef(in element), new IntPtr(i)));
if (prefix) builder.Append("0b");
AppendBinary(builder, v);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Kalk.IntrinsicsGen/Kalk.IntrinsicsGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Broslyn" Version="1.2.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.6.1" />
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.7.1" />
<PackageReference Include="Scriban" Version="5.9.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 11 additions & 4 deletions src/Kalk.Tests/Kalk.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -16,9 +16,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />

<Using Include="NUnit.Framework" />
<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />
<Using Include="NUnit.Framework.Legacy.CollectionAssert" Alias="CollectionAssert" />
<Using Include="NUnit.Framework.Legacy.StringAssert" Alias="StringAssert" />
<Using Include="NUnit.Framework.Legacy.DirectoryAssert" Alias="DirectoryAssert" />
<Using Include="NUnit.Framework.Legacy.FileAssert" Alias="FileAssert" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down

0 comments on commit 80cd768

Please sign in to comment.