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

Evaluate Apple Silicon for CI #1693

Merged
merged 31 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9e82721
Evaluate Apple Silicon for CI
Perksey Oct 2, 2023
157a2bc
Let's see what happens if we don't install old .NET versions
Perksey Oct 2, 2023
5b95eca
sus error message on .NET 6
Perksey Oct 2, 2023
ac4736d
BinaryFormatter 🤮🤮🤮
Perksey Oct 2, 2023
49287c5
Work around some deficiencies in the RC1 SDK (dotnet/sdk#35811)
Perksey Oct 2, 2023
6f91a07
oops
Perksey Oct 2, 2023
ea11612
github.dev find+replace does not work
Perksey Oct 2, 2023
9059f13
Maths unit tests are now .NET 8
Perksey Oct 2, 2023
dd5535b
Vulkan unit tests are now .NET 8
Perksey Oct 2, 2023
f818f9b
Ok let's just disable tests for now
Perksey Oct 2, 2023
f7faa5e
Don't forget the public API!
Perksey Oct 2, 2023
b1059f9
Attempt to fix android, as well as cache to make faster maybe
Perksey Oct 3, 2023
ec8602b
Install Android platforms
Perksey Oct 3, 2023
24c55ca
Reenable .NET 6?
Perksey Oct 3, 2023
4c822b5
Install workloads for .NET 6 and .NET 8
Perksey Oct 3, 2023
507c061
Comical hack
Perksey Oct 3, 2023
619bea8
ANNIHILATE .NET 8
Perksey Oct 3, 2023
bf800a6
Install Android 31
Perksey Oct 3, 2023
1880df0
Maybe the tests are fine on .NET 6?
Perksey Oct 3, 2023
de229e2
they were not fine
Perksey Oct 3, 2023
84151b7
Forgo Apple Silicon for now
Perksey Oct 3, 2023
cb9d281
Apparently caching is slower than JUST DOING IT
Perksey Oct 4, 2023
85b722c
Fix a very sus unit test failure
Perksey Oct 6, 2023
c734897
Just testing something...
Perksey Oct 6, 2023
2217b55
Update build.yml
Perksey Oct 6, 2023
ff0859c
attempt 2
Perksey Oct 6, 2023
d49beee
Tinker with Apple Silicon again
Perksey Oct 9, 2023
c799785
Detailed verbosity, will probably regret this
Perksey Oct 9, 2023
d7e3a3d
Merge branch 'main' into hotfix/apple-silicon-xlarge-runner
Perksey Oct 9, 2023
c709905
Update .NET 6
Perksey Oct 9, 2023
c3a1dc0
Update build/nuke/Build.Support.cs
Perksey Oct 9, 2023
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
59 changes: 28 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ permissions:
packages: write
jobs:
Build:
# This will:
# - use windows-quick (self-hosted only) for release tags on this repo
# - use windows-2022 (self-hosted or GitHub-hosted depending on what's available) for development in this repo
# - use windows-latest (GitHub-hosted only) in all other cases (i.e. community contributions)
# Note: the reason we use windows-2022 instead of windows-latest is so that both the self-hosted runner
# (which has the windows-2022 label but NOT the windows-latest label) and the GitHub hosted runner are
# treated as candidates. We will never have a windows-latest self-hosted runner even if it is the latest.
runs-on: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') && 'windows-quick' || github.repository == 'dotnet/Silk.NET' && 'windows-2022' || 'windows-latest' }}
runs-on: macos-13-large
Perksey marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/[email protected]
with:
Expand All @@ -33,41 +26,45 @@ jobs:
with:
java-version: 11
distribution: "temurin"
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.102
- name: Setup Android Environment
uses: android-actions/setup-android@v2
env:
ANDROID_SDK_ROOT: /Users/runner/Library/Android/sdk
- name: Install Android Platforms
run: |
sdkmanager --install "build-tools;32.0.0"
sdkmanager --install "platform-tools"
sdkmanager --install "platforms;android-31"
sdkmanager --install "platforms;android-33"
sdkmanager --install "platforms;android-34"
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Setup .NET Core 3.1
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
dotnet-version: 7.0.102
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android ios maccatalyst maui
- name: Test
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
# dotnet test will compile the necessary projects for testing only.
run: .\build.cmd Test --skip Clean Restore Compile
#- name: Test
# if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# # skip Clean, Restore, and Compile as this will build the affect the whole solution.
# # dotnet test will compile the necessary projects for testing only.
# run: ./build.sh Test --skip Clean Restore Compile
- name: Validation Checks
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
run: .\build.cmd ValidateSolution
run: ./build.sh ValidateSolution
- name: Pack (CI)
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# TODO build native mixins such as BuildLibSilkDroid
run: .\build.cmd Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
run: ./build.sh Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
env:
ANDROID_HOME: /Users/runner/Library/Android/sdk
- name: Pack (CD)
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
# TODO build native mixins such as BuildLibSilkDroid
run: .\build.cmd Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
run: ./build.sh Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
- name: Upload Unsigned Artifacts to Actions
uses: actions/[email protected]
with:
Expand All @@ -77,13 +74,13 @@ jobs:
retention-days: 1
- name: Sign Packages
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
run: .\build.cmd SignPackages --akv-certificate ${{ secrets.AKV_CERTIFICATE }} --akv-client-id ${{ secrets.AKV_CLIENT_ID }} --akv-client-secret ${{ secrets.AKV_CLIENT_SECRET }} --akv-tenant ${{ secrets.AKV_TENANT }} --akv-vault-url ${{ secrets.AKV_VAULT_URL }}
run: ./build.sh SignPackages --akv-certificate ${{ secrets.AKV_CERTIFICATE }} --akv-client-id ${{ secrets.AKV_CLIENT_ID }} --akv-client-secret ${{ secrets.AKV_CLIENT_SECRET }} --akv-tenant ${{ secrets.AKV_TENANT }} --akv-vault-url ${{ secrets.AKV_VAULT_URL }}
- name: Push to Experimental Feed
if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
run: .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://dotnet.github.io/Silk.NET/nuget/experimental/index.json --nuget-username ${{ secrets.EXP_NUGET_USERNAME }} --nuget-password ${{ secrets.EXP_NUGET_PASSWORD }} --nuget-api-key ${{ secrets.EXP_NUGET_PASSWORD }}
run: ./build.sh PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://dotnet.github.io/Silk.NET/nuget/experimental/index.json --nuget-username ${{ secrets.EXP_NUGET_USERNAME }} --nuget-password ${{ secrets.EXP_NUGET_PASSWORD }} --nuget-api-key ${{ secrets.EXP_NUGET_PASSWORD }}
- name: Push to GitHub Packages
if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
run: .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
- name: Upload Signed Artifacts to Actions
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/[email protected]
Expand All @@ -93,5 +90,5 @@ jobs:
if-no-files-found: warn
- name: Push to NuGet
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
run: .\build.cmd PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}
run: ./build.sh PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}

3 changes: 2 additions & 1 deletion build/nuke/Silk.NET.NUKE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..\..</NukeRootDirectory>
<NukeScriptDirectory>..\..</NukeScriptDirectory>
<LangVersion>preview</LangVersion>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Description Condition="'$(Description)' == ''">
Silk.NET is a high-speed, advanced library, providing bindings to popular low-level APIs such as OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, and DirectX.
</Description>
<CheckEolWorkloads>false</CheckEolWorkloads>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('net6')) or $(TargetFramework.StartsWith('net7')) or $(TargetFramework.StartsWith('net8'))">
<IsTrimmable>true</IsTrimmable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;netframework4.8</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<IsPackable>false</IsPackable>

Expand Down
6 changes: 3 additions & 3 deletions src/Maths/Silk.NET.Maths/Silk.NET.Maths.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<WarningsAsErrors>true</WarningsAsErrors>
<LangVersion>9.0</LangVersion>

<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0'">$(DefineConstants);SSE</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);BTEC_INTRINSICS;MATHF</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0'">$(DefineConstants);POH;AdvSIMD</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'net6.0-android' Or '$(TargetFramework)' == 'net6.0-ios'">$(DefineConstants);SSE</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'net6.0-android' Or '$(TargetFramework)' == 'net6.0-ios' Or '$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);BTEC_INTRINSICS;MATHF</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0' Or '$(TargetFramework)' == 'net6.0-android' Or '$(TargetFramework)' == 'net6.0-ios'">$(DefineConstants);POH;AdvSIMD</DefineConstants>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
Expand Down
8 changes: 6 additions & 2 deletions src/Vulkan/Silk.NET.Vulkan.Tests/TestChains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ public unsafe void TestChainDuplicate()
Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr);

// Test equality
Assert.Equal(chain, newChain);
Assert.Equal(chain.Head with {PNext = null}, newChain.Head with {PNext = null});
Assert.Equal(chain.Item1, newChain.Item1);
Assert.Equal((nint)chain.Head.PNext, (nint)chain.Item1Ptr);
Assert.True(chain == newChain);

// Modify second chain
Expand Down Expand Up @@ -433,7 +435,9 @@ public unsafe void TestChainGetHashCode()
Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr);

// Test equality
Assert.Equal(chain, newChain);
Assert.Equal(chain.Head with {PNext = null}, newChain.Head with {PNext = null});
Assert.Equal(chain.Item1, newChain.Item1);
Assert.Equal((nint)chain.Head.PNext, (nint)chain.Item1Ptr);
Assert.True(chain == newChain);
var hashCode = chain.GetHashCode();
var newHashCode = newChain.GetHashCode();
Expand Down
4 changes: 3 additions & 1 deletion src/Vulkan/Silk.NET.Vulkan.Tests/TestChainsAny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public unsafe void TestChainDuplicateAny()
Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr);

// Test equality
Assert.Equal(chain, newChain);
Assert.Equal(chain.Head with {PNext = null}, newChain.Head with {PNext = null});
Assert.Equal(chain.Item1, newChain.Item1);
Assert.Equal((nint)chain.Head.PNext, (nint)chain.Item1Ptr);
Assert.True(chain == newChain);
}

Expand Down
Loading