mirror of
https://github.com/ivuorinen/hiha-arvio.git
synced 2026-03-12 06:00:27 +00:00
feat: upgrade to .NET 9 / C# 13, latest packages & actions, add Copilot instructions (#2)
This commit is contained in:
94
.github/copilot-instructions.md
vendored
Normal file
94
.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
# GitHub Copilot Instructions for HihaArvio
|
||||
|
||||
## Authoritative Reference
|
||||
|
||||
**CLAUDE.md is the single source of truth for this repository.**
|
||||
|
||||
All guidelines, architecture decisions, implementation requirements, and coding standards defined in [`CLAUDE.md`](../CLAUDE.md) at the repository root MUST be followed without exception. CLAUDE.md takes absolute precedence over any other instruction, convention, or assumption.
|
||||
|
||||
Before suggesting, generating, or reviewing any code for this repository, read and internalize CLAUDE.md in its entirety.
|
||||
|
||||
## Non-Negotiable Rules
|
||||
|
||||
The following rules are derived from CLAUDE.md and additional Copilot-specific code quality guidelines. All MUST be enforced in every interaction:
|
||||
|
||||
### Language & Framework
|
||||
|
||||
- **Target framework:** .NET 9, using C# 13
|
||||
- **UI framework:** .NET MAUI (multi-platform)
|
||||
- **Nullable reference types MUST be enabled** across all projects
|
||||
- **All compiler warnings MUST be treated as errors** (`<TreatWarningsAsErrors>true</TreatWarningsAsErrors>`)
|
||||
- Language version MUST be set to `13` in all project files
|
||||
|
||||
### Architecture (MVVM – Strict Separation)
|
||||
|
||||
- **Models**: Plain data objects only — no business logic
|
||||
- **ViewModels**: All presentation logic — 100% testable without UI dependencies
|
||||
- **Views**: Thin layer — data binding only, minimal code-behind
|
||||
- **Services**: All business logic and infrastructure concerns
|
||||
|
||||
### Dependency Injection
|
||||
|
||||
- All services MUST be injected via constructor — never use the service locator pattern or `new` inside ViewModels
|
||||
- Register all services in `MauiProgram.cs`
|
||||
- Platform-specific implementations use `#if IOS`, `#elif WINDOWS || MACCATALYST`
|
||||
|
||||
### Testing Requirements
|
||||
|
||||
- Test coverage MUST be ≥ 95 % (measured by Coverlet; threshold enforcement is a future CI/CD enhancement)
|
||||
- Testing stack: **xUnit + NSubstitute + FluentAssertions**
|
||||
- All tests MUST use deterministic, seeded randomness — never `Random.Shared`
|
||||
- All external dependencies (sensors, database, file system) MUST be mocked
|
||||
- Use test-data builders for complex objects
|
||||
|
||||
### Security
|
||||
|
||||
- Estimate selection MUST use `System.Security.Cryptography.RandomNumberGenerator` — never `System.Random`
|
||||
- No external data transmission — all data is stored locally only
|
||||
- Request the minimum required platform permissions
|
||||
|
||||
### Commit & Code Quality
|
||||
|
||||
- Use **semantic / conventional commit** messages (e.g. `feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`)
|
||||
- Make **atomic commits** — one logical change per commit
|
||||
- Run all linting and build tools; automatically fix all reported issues before committing
|
||||
- Follow the `.editorconfig` rules present in the repository root
|
||||
|
||||
## Technology Stack (Current Versions)
|
||||
|
||||
| Component | Version |
|
||||
|---|---|
|
||||
| .NET SDK | 9.0.x |
|
||||
| C# Language | 13 |
|
||||
| Microsoft.Maui.Controls | 9.0.120 |
|
||||
| Microsoft.Maui.Controls.Compatibility | 9.0.120 |
|
||||
| CommunityToolkit.Mvvm | 8.4.0 |
|
||||
| SQLite (sqlite-net-pcl) | 1.9.172 |
|
||||
| SQLitePCLRaw.bundle_green | 2.1.11 |
|
||||
| Microsoft.Extensions.Logging.Debug | 9.0.13 |
|
||||
| xUnit | 2.9.3 |
|
||||
| xunit.runner.visualstudio | 2.8.2 |
|
||||
| Microsoft.NET.Test.Sdk | 18.3.0 |
|
||||
| NSubstitute | 5.3.0 |
|
||||
| FluentAssertions | 8.8.0 |
|
||||
| coverlet.collector | 8.0.0 |
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `CLAUDE.md` | **Authoritative project guide** — always read first |
|
||||
| `spec.md` | Formal RFC 2119 requirements (MUST / SHALL / REQUIRED) |
|
||||
| `docs/plans/2025-11-18-hiha-arvio-design.md` | Validated architecture decisions |
|
||||
| `src/HihaArvio/HihaArvio.csproj` | Main MAUI project |
|
||||
| `tests/HihaArvio.Tests/HihaArvio.Tests.csproj` | Unit & integration tests |
|
||||
| `.editorconfig` | Code style enforcement |
|
||||
|
||||
## Easter Egg — Never Expose
|
||||
|
||||
The hidden humorous mode triggered by shaking for > 15 seconds MUST NOT have any visible UI indication and MUST NOT be mentioned in any UI element, setting, or documentation visible to users.
|
||||
|
||||
## When in Doubt
|
||||
|
||||
If there is any ambiguity, consult **CLAUDE.md** and **spec.md** — in that order.
|
||||
Do not invent architecture, add dependencies, or change platform targets without explicit justification grounded in those documents.
|
||||
34
.github/workflows/README.md
vendored
34
.github/workflows/README.md
vendored
@@ -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
|
||||
|
||||
42
.github/workflows/build.yml
vendored
42
.github/workflows/build.yml
vendored
@@ -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:
|
||||
|
||||
44
.github/workflows/publish.yml
vendored
44
.github/workflows/publish.yml
vendored
@@ -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 }}
|
||||
|
||||
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user