Skip to content

Commit f27e9bf

Browse files
committed
Try using macos-26
1 parent c09a946 commit f27e9bf

File tree

4 files changed

+93
-152
lines changed

4 files changed

+93
-152
lines changed

.github/workflows/Build.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/Nightly.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Upload test results and nightly builds
2+
3+
on: [push, pull_request]
4+
jobs:
5+
Everything:
6+
runs-on: windows-latest
7+
steps:
8+
- name: Update draft on GitHub Releases
9+
id: release_drafter
10+
uses: release-drafter/release-drafter@v6
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: actions/checkout@v6
14+
with:
15+
submodules: 'recursive'
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v5
18+
with:
19+
dotnet-version: '10.x'
20+
- name: Build and Test
21+
env:
22+
RELEASE_NOTES: |
23+
# ${{ steps.release_drafter.outputs.name }}
24+
25+
${{ steps.release_drafter.outputs.body }}
26+
run: |
27+
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
28+
# PowerShell string replacement
29+
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'
30+
31+
dotnet workload restore
32+
# --collect:"XPlat Code Coverage" means collect test coverage with https://github.com/coverlet-coverage/coverlet
33+
# Coverlet settings come after --: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md#advanced-options-supported-via-runsettings
34+
dotnet test CSharpMath.sln -c Release -l GitHubActions --blame --collect:"XPlat Code Coverage" --results-directory .testcoverage -p:PackageReleaseNotes="$env:RELEASE_NOTES" -p:PackageVersion=${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }} -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeTestAssembly=true
35+
shell: pwsh
36+
- name: Run ReportGenerator on Test Coverage results
37+
uses: danielpalme/ReportGenerator-GitHub-Action@5
38+
with:
39+
reports: '.testcoverage/**/*.*' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
40+
targetdir: '.testcoverage/report' # REQUIRED # The directory where the generated report should be saved.
41+
reporttypes: 'Html' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
42+
title: 'CSharpMath test coverage results' # Optional title.
43+
tag: ${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }} # Optional tag or build version.
44+
- name: Upload CSharpMath test coverage results as CI artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: CSharpMath test coverage results
48+
path: .testcoverage/
49+
- name: Upload CSharpMath test coverage results to codecov.io
50+
uses: codecov/codecov-action@v4
51+
with:
52+
file: .testcoverage/**/*.xml # optional
53+
name: CSharpMath test coverage # optional
54+
fail_ci_if_error: false # optional (default = false)
55+
- name: Upload CSharpMath.Rendering.Tests results as CI artifacts
56+
uses: actions/upload-artifact@v4
57+
if: always() # Run even when a previous step failed: https://stackoverflow.com/a/58859404/5429648
58+
with:
59+
name: CSharpMath.Rendering.Tests results
60+
path: CSharpMath.Rendering.Tests/*/*.png
61+
- name: Upload CSharpMath.Xaml.Tests.NuGet results as CI artifacts
62+
uses: actions/upload-artifact@v4
63+
if: always()
64+
with:
65+
name: CSharpMath.Xaml.Tests.NuGet results
66+
path: CSharpMath.Xaml.Tests.NuGet/*.png
67+
- name: Upload NuGet packages as CI artifacts
68+
uses: actions/upload-artifact@v4
69+
if: always()
70+
with:
71+
name: NuGet packages
72+
path: .nupkgs/
73+
- name: Push CI artifacts to GitHub Packages registry
74+
if: github.ref == 'refs/heads/master'
75+
run: |
76+
# "dotnet nuget push" with "dotnet nuget add source" to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775#issuecomment-714509211
77+
# So we must specify api-key directly in "dotnet nuget push" instead of following the GitHub Packages documentation
78+
# We use quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120
79+
# --no-symbols true to not let GitHub Releases interpret .snupkg as .nupkg
80+
dotnet nuget push '.nupkgs/*.nupkg' --source 'https://nuget.pkg.github.com/verybadcat/index.json' --api-key ${{ github.token }} --skip-duplicate --no-symbols true
81+
shell: pwsh

.github/workflows/Test.yml

Lines changed: 11 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Test
1+
name: Build and Test
22

33
on: [push, pull_request]
44
jobs:
5-
Projects:
5+
Everything:
66
strategy:
77
matrix:
8-
os: [ubuntu-latest, macos-latest]
8+
# Check required Xcode version for latest "dotnet workload restore": https://github.com/dotnet/macios/releases
9+
# Check included Xcode versions for GitHub Actions: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
10+
os: [windows-latest, ubuntu-latest, macos-26]
911
runs-on: ${{ matrix.os }}
1012
steps:
1113
- uses: actions/checkout@v6
@@ -15,106 +17,9 @@ jobs:
1517
uses: actions/setup-dotnet@v5
1618
with:
1719
dotnet-version: '10.x'
18-
- name: Query required Xcode version
19-
if: matrix.os == 'macos-latest'
20-
id: xcode-version
21-
run: |
22-
dotnet workload restore # restore workloads to find installed SDKs
23-
24-
# Find the installed MacCatalyst SDK pack after workload restore
25-
SDK_PATH=$(find ~/.dotnet/packs -name "Microsoft.MacCatalyst.Sdk.net*" -type d 2>/dev/null | head -1)
26-
27-
if [ -n "$SDK_PATH" ]; then
28-
# Extract version from path (e.g., Microsoft.MacCatalyst.Sdk.net10.0_26.2)
29-
XCODE_VERSION=$(basename "$SDK_PATH" | sed -n 's/.*_\([0-9]*\.[0-9]*\).*/\1/p')
30-
echo "Required Xcode version from SDK: $XCODE_VERSION"
31-
echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
32-
else
33-
echo "Could not determine required Xcode version, using latest-stable"
34-
echo "xcode-version=latest-stable" >> $GITHUB_OUTPUT
35-
fi
36-
shell: bash
37-
- name: Setup Xcode
38-
if: matrix.os == 'macos-latest'
39-
uses: maxim-lobanov/setup-xcode@v1
40-
with:
41-
xcode-version: ${{ steps.xcode-version.outputs.xcode-version }}
42-
- name: Build and Test
43-
run: dotnet test CSharpMath.sln -c Release -l GitHubActions --blame
44-
Everything:
45-
runs-on: windows-latest
46-
steps:
47-
- name: Update draft on GitHub Releases
48-
id: release_drafter
49-
uses: release-drafter/release-drafter@v6
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
- uses: actions/checkout@v6
53-
with:
54-
submodules: 'recursive'
55-
- name: Setup .NET
56-
uses: actions/setup-dotnet@v5
57-
with:
58-
dotnet-version: '10.x'
59-
- name: Build and Test
60-
env:
61-
RELEASE_NOTES: |
62-
# ${{ steps.release_drafter.outputs.name }}
63-
64-
${{ steps.release_drafter.outputs.body }}
65-
run: |
66-
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
67-
# PowerShell string replacement
68-
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'
69-
70-
dotnet workload restore
71-
# --collect:"XPlat Code Coverage" means collect test coverage with https://github.com/coverlet-coverage/coverlet
72-
# Coverlet settings come after --: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md#advanced-options-supported-via-runsettings
73-
dotnet test CSharpMath.sln -c Release -l GitHubActions --blame --collect:"XPlat Code Coverage" --results-directory .testcoverage -p:PackageReleaseNotes="$env:RELEASE_NOTES" -p:PackageVersion=${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }} -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeTestAssembly=true
74-
shell: pwsh
75-
- name: Run ReportGenerator on Test Coverage results
76-
uses: danielpalme/ReportGenerator-GitHub-Action@5
77-
with:
78-
reports: '.testcoverage/**/*.*' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
79-
targetdir: '.testcoverage/report' # REQUIRED # The directory where the generated report should be saved.
80-
reporttypes: 'Html' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
81-
title: 'CSharpMath test coverage results' # Optional title.
82-
tag: ${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }} # Optional tag or build version.
83-
- name: Upload CSharpMath test coverage results as CI artifacts
84-
uses: actions/upload-artifact@v4
85-
with:
86-
name: CSharpMath test coverage results
87-
path: .testcoverage/
88-
- name: Upload CSharpMath test coverage results to codecov.io
89-
uses: codecov/codecov-action@v4
90-
with:
91-
file: .testcoverage/**/*.xml # optional
92-
name: CSharpMath test coverage # optional
93-
fail_ci_if_error: false # optional (default = false)
94-
- name: Upload CSharpMath.Rendering.Tests results as CI artifacts
95-
uses: actions/upload-artifact@v4
96-
if: always() # Run even when a previous step failed: https://stackoverflow.com/a/58859404/5429648
97-
with:
98-
name: CSharpMath.Rendering.Tests results
99-
path: CSharpMath.Rendering.Tests/*/*.png
100-
- name: Upload CSharpMath.Xaml.Tests.NuGet results as CI artifacts
101-
uses: actions/upload-artifact@v4
102-
if: always()
103-
with:
104-
name: CSharpMath.Xaml.Tests.NuGet results
105-
path: CSharpMath.Xaml.Tests.NuGet/*.png
106-
- name: Upload NuGet packages as CI artifacts
107-
uses: actions/upload-artifact@v4
108-
if: always()
109-
with:
110-
name: NuGet packages
111-
path: .nupkgs/
112-
- name: Push CI artifacts to GitHub Packages registry
113-
if: github.ref == 'refs/heads/master'
114-
run: |
115-
# "dotnet nuget push" with "dotnet nuget add source" to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775#issuecomment-714509211
116-
# So we must specify api-key directly in "dotnet nuget push" instead of following the GitHub Packages documentation
117-
# We use quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120
118-
# --no-symbols true to not let GitHub Releases interpret .snupkg as .nupkg
119-
dotnet nuget push '.nupkgs/*.nupkg' --source 'https://nuget.pkg.github.com/verybadcat/index.json' --api-key ${{ github.token }} --skip-duplicate --no-symbols true
120-
shell: pwsh
20+
- name: Install MAUI workloads
21+
run: dotnet workload restore
22+
- name: Build Everything
23+
run: dotnet build CSharpMath.sln -c Release
24+
- name: Run Tests
25+
run: dotnet test CSharpMath.sln -c Release -l GitHubActions

CSharpMath.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ EndProject
6363
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{86C13BAB-EE19-4E82-B36F-2FEE92754B30}"
6464
ProjectSection(SolutionItems) = preProject
6565
.github\workflows\Benchmark.yml = .github\workflows\Benchmark.yml
66-
.github\workflows\Build.yml = .github\workflows\Build.yml
6766
.github\workflows\Release.yml = .github\workflows\Release.yml
67+
.github\workflows\Nightly.yml = .github\workflows\Nightly.yml
6868
.github\workflows\Test.yml = .github\workflows\Test.yml
6969
EndProjectSection
7070
EndProject

0 commit comments

Comments
 (0)