feat: upgrade to .NET 9 / C# 13, latest packages & actions, add Copilot instructions (#2)

This commit is contained in:
Copilot
2026-03-06 02:39:56 +02:00
committed by GitHub
parent 7639eb1cfc
commit 76ff24b34c
12 changed files with 224 additions and 596 deletions

View File

@@ -12,9 +12,9 @@ This directory contains the CI/CD workflows for HihaArvio.
**What it does**:
- Runs on Ubuntu (fastest, cheapest for tests)
- Sets up .NET 8.0
- Builds the solution for `net8.0` target
- Runs all 189 xUnit tests
- Sets up .NET 9.0
- Restores and builds `tests/HihaArvio.Tests/HihaArvio.Tests.csproj` for the `net9.0` target
- Runs all xUnit tests in `tests/HihaArvio.Tests/HihaArvio.Tests.csproj`
- Publishes test results and coverage reports
- Uploads test artifacts for review
@@ -32,8 +32,8 @@ This directory contains the CI/CD workflows for HihaArvio.
**Purpose**: Build the application for all supported platforms.
**What it does**:
- **iOS Job**: Builds for iOS 15.0+ on macOS-14 runner
- **macOS Catalyst Job**: Builds for macOS 12.0+ on macOS-14 runner
- **iOS Job**: Builds for iOS 15.0+ on macOS-26 runner
- **macOS Catalyst Job**: Builds for macOS 12.0+ on macOS-26 runner
- Installs .NET MAUI workload
- Builds without code signing (for CI verification)
- Uploads build artifacts (`.app` bundles)
@@ -98,16 +98,16 @@ Tags containing `alpha`, `beta`, or `rc` are marked as pre-releases.
### Running Tests Locally
```bash
dotnet test HihaArvio.sln -f net8.0
dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj -f net9.0
```
### Building Locally
```bash
# iOS
dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-ios -c Release
dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-ios -c Release
# macOS Catalyst
dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-maccatalyst -c Release
dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-maccatalyst -c Release
```
### Creating a Release
@@ -146,16 +146,16 @@ For signed releases, add:
### Runner Requirements
- **Test**: `ubuntu-latest` (any Linux runner)
- **Build**: `macos-14` (Apple Silicon runner for MAUI workloads)
- **Publish**: `macos-14` (Apple Silicon runner for MAUI workloads)
- **Build**: `macos-26` (Apple Silicon runner with Xcode 26 for MAUI workloads)
- **Publish**: `macos-26` (Apple Silicon runner with Xcode 26 for MAUI workloads)
### External Actions Used
- `actions/checkout@v4` - Checkout repository
- `actions/setup-dotnet@v4` - Setup .NET SDK
- `actions/upload-artifact@v4` - Upload build artifacts
- `actions/create-release@v1` - Create GitHub releases
- `actions/upload-release-asset@v1` - Upload release assets
- `dorny/test-reporter@v1` - Generate test reports
- `actions/checkout@v6.0.2` - Checkout repository
- `actions/setup-dotnet@v5.2.0` - Setup .NET SDK
- `actions/upload-artifact@v7.0.0` - Upload build artifacts
- `softprops/action-gh-release@v2.5.0` - Create GitHub releases
- `actions/download-artifact@v8.0.0` - Download build artifacts for release
- `dorny/test-reporter@v2.6.0` - Generate test reports
---
@@ -164,7 +164,7 @@ For signed releases, add:
### Tests Failing
Check test output in workflow logs. Run locally with:
```bash
dotnet test HihaArvio.sln -f net8.0 --verbosity detailed
dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj -f net9.0 --verbosity detailed
```
### Build Failing

View File

@@ -10,64 +10,74 @@ on:
jobs:
build-ios:
name: Build iOS
runs-on: macos-latest
runs-on: macos-26
permissions:
contents: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '26.0'
- name: Restore workloads
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
- name: Build iOS
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-ios -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-ios -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
- name: Upload iOS build artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ios-build
path: |
src/HihaArvio/bin/Release/net8.0-ios/**/*.app
src/HihaArvio/bin/Release/net8.0-ios/**/*.ipa
src/HihaArvio/bin/Release/net9.0-ios/**/*.app
src/HihaArvio/bin/Release/net9.0-ios/**/*.ipa
retention-days: 7
build-maccatalyst:
name: Build macOS Catalyst
runs-on: macos-latest
runs-on: macos-26
permissions:
contents: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '26.0'
- name: Restore workloads
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
- name: Build macOS Catalyst
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net8.0-maccatalyst -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
run: dotnet build src/HihaArvio/HihaArvio.csproj -f net9.0-maccatalyst -c Release /p:ArchiveOnBuild=false /p:EnableCodeSigning=false
- name: Upload macOS build artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: maccatalyst-build
path: |
src/HihaArvio/bin/Release/net8.0-maccatalyst/**/*.app
src/HihaArvio/bin/Release/net8.0-maccatalyst/**/*.pkg
src/HihaArvio/bin/Release/net9.0-maccatalyst/**/*.app
src/HihaArvio/bin/Release/net9.0-maccatalyst/**/*.pkg
retention-days: 7
build-status:

View File

@@ -12,19 +12,19 @@ on:
type: string
env:
DOTNET_VERSION: '8.0.x'
DOTNET_VERSION: '9.0.x'
jobs:
build-ios:
name: Build iOS
runs-on: macos-latest
runs-on: macos-26
permissions:
contents: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get version
id: get_version
@@ -36,17 +36,22 @@ jobs:
fi
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '26.0'
- name: Restore workloads
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
- name: Build iOS Release
run: |
dotnet publish src/HihaArvio/HihaArvio.csproj \
-f net8.0-ios \
-f net9.0-ios \
-c Release \
/p:ApplicationDisplayVersion=${{ steps.get_version.outputs.version }} \
/p:ApplicationVersion=${{ github.run_number }} \
@@ -55,7 +60,7 @@ jobs:
- name: Create iOS artifact archive
run: |
cd src/HihaArvio/bin/Release/net8.0-ios
cd src/HihaArvio/bin/Release/net9.0-ios
# Find the .app bundle (it's in a subdirectory like iossimulator-arm64 or ios-arm64)
APP_PATH=$(find . -name "*.app" -type d | head -n 1)
if [ -z "$APP_PATH" ]; then
@@ -66,7 +71,7 @@ jobs:
mv HihaArvio-iOS-${{ steps.get_version.outputs.version }}.zip ${{ github.workspace }}/
- name: Upload iOS artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ios-release
path: HihaArvio-iOS-${{ steps.get_version.outputs.version }}.zip
@@ -74,14 +79,14 @@ jobs:
build-maccatalyst:
name: Build macOS
runs-on: macos-latest
runs-on: macos-26
permissions:
contents: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get version
id: get_version
@@ -93,17 +98,22 @@ jobs:
fi
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Select Xcode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: '26.0'
- name: Restore workloads
run: dotnet workload restore src/HihaArvio/HihaArvio.csproj
- name: Build macOS Catalyst Release
run: |
dotnet publish src/HihaArvio/HihaArvio.csproj \
-f net8.0-maccatalyst \
-f net9.0-maccatalyst \
-c Release \
/p:ApplicationDisplayVersion=${{ steps.get_version.outputs.version }} \
/p:ApplicationVersion=${{ github.run_number }} \
@@ -112,7 +122,7 @@ jobs:
- name: Create macOS artifact archive
run: |
cd src/HihaArvio/bin/Release/net8.0-maccatalyst
cd src/HihaArvio/bin/Release/net9.0-maccatalyst
# Find the .app bundle (it's in a subdirectory like maccatalyst-x64 or maccatalyst-arm64)
APP_PATH=$(find . -name "*.app" -type d | head -n 1)
if [ -z "$APP_PATH" ]; then
@@ -123,7 +133,7 @@ jobs:
mv HihaArvio-macOS-${{ steps.get_version.outputs.version }}.zip ${{ github.workspace }}/
- name: Upload macOS artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: maccatalyst-release
path: HihaArvio-macOS-${{ steps.get_version.outputs.version }}.zip
@@ -140,7 +150,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
@@ -172,17 +182,17 @@ jobs:
fi
- name: Download iOS artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: ios-release
- name: Download macOS artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: maccatalyst-release
- name: Create Release
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', github.event.inputs.version) || github.ref_name }}
name: Release ${{ steps.get_version.outputs.version }}

View File

@@ -17,21 +17,21 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj /p:TargetFrameworks=net8.0
run: dotnet restore tests/HihaArvio.Tests/HihaArvio.Tests.csproj /p:TargetFrameworks=net9.0
- name: Build test project
run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore /p:TargetFrameworks=net8.0
run: dotnet build tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-restore /p:TargetFrameworks=net9.0
- name: Run tests with coverage
run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal /p:TargetFrameworks=net8.0 --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
run: dotnet test tests/HihaArvio.Tests/HihaArvio.Tests.csproj --configuration Release --no-build --verbosity normal /p:TargetFrameworks=net9.0 --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx"
- name: Install ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
@@ -43,14 +43,14 @@ jobs:
run: |
# Extract and display line coverage percentage
COVERAGE=$(grep -oP 'Line coverage: \K[\d.]+' coverage/Summary.txt | head -1)
echo "📊 Code coverage for net8.0 target: ${COVERAGE}%"
echo "📊 Code coverage for net9.0 target: ${COVERAGE}%"
echo ""
echo "Note: Multi-target MAUI projects cannot achieve full coverage on Linux runners."
echo "Platform-specific code (iOS/macOS) is excluded when building net8.0 only."
echo "Platform-specific code (iOS/macOS) is excluded when building net9.0 only."
echo "Full coverage measurement requires macOS runners with all target frameworks."
- name: Upload coverage report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: coverage-report
@@ -58,7 +58,7 @@ jobs:
retention-days: 30
- name: Publish test results
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
uses: dorny/test-reporter@3d76b34a4535afbd0600d347b09a6ee5deb3ed7f # v2.6.0
if: always()
with:
name: Test Results
@@ -67,7 +67,7 @@ jobs:
fail-on-error: true
- name: Upload test results
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: test-results