Skip to content

Commit 4dabc6a

Browse files
authored
Merge pull request #10 from managedcode/fix-tests
Fix tests
2 parents ed8ab95 + baf1e1a commit 4dabc6a

35 files changed

+2241
-195
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ dotnet_diagnostic.CA1010.severity = none
143143

144144
# Use collection expressions (C# 12+)
145145
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
146+
dotnet_diagnostic.CA1502.severity = warning
146147

147148
# Code block preferences
148149
csharp_prefer_simple_default_expression = true:suggestion

.github/steps/install_dependencies/action.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
name: Install Dependencies
2-
description: ""
2+
description: "Install the pinned .NET SDK, required host prerequisites, and Uno workloads for CI validation."
33

44
inputs:
55
target-platform:
66
description: 'The platform to install dependencies for. #See available values at https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html'
77
required: false
88
default: 'all'
9-
dotnet-version:
10-
description: 'Installs and sets the .NET SDK Version'
9+
install-windows-sdk:
10+
description: 'Whether to install the Windows SDK ISO bootstrap step. Leave false for normal dotnet-based CI validation.'
1111
required: false
12-
default: '10.0.x'
12+
default: 'false'
13+
run-uno-check:
14+
description: 'Whether to run uno-check and install Uno workloads. Leave false for normal dotnet-based CI validation.'
15+
required: false
16+
default: 'false'
1317
sdkVersion:
1418
description: 'The version of the Windows Sdk'
1519
required: false
@@ -19,20 +23,21 @@ runs:
1923
using: "composite"
2024
steps:
2125
# Install .NET
22-
- name: Setup .NET ${{ inputs.dotnet-version }}
23-
uses: actions/setup-dotnet@v3
26+
- name: Setup .NET SDK from global.json
27+
uses: actions/setup-dotnet@v5
2428
with:
25-
dotnet-version: '${{ inputs.dotnet-version }}'
29+
global-json-file: 'global.json'
2630

2731
# Install Windows SDK
2832
- name: Install Windows SDK ${{ inputs.sdkVersion }}
2933
shell: pwsh
30-
if: ${{ runner.os == 'Windows' }}
34+
if: ${{ runner.os == 'Windows' && inputs.install-windows-sdk == 'true' }}
3135
run: .\.github\Install-WindowsSdkISO.ps1 ${{ inputs.sdkVersion }}
3236

3337
# Run Uno.Check
3438
- name: Install ${{ inputs.target-platform }} Workloads
3539
shell: pwsh
40+
if: ${{ inputs.run-uno-check == 'true' }}
3641
run: |
3742
dotnet tool install -g uno.check
3843
("${{ inputs.target-platform }} ".Split(' ') | ForEach-Object {
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build Validation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/**
8+
9+
pull_request:
10+
types: [opened, synchronize, reopened, ready_for_review]
11+
branches:
12+
- main
13+
- release/**
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: build-validation-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build:
25+
name: Quality Gate
26+
runs-on: windows-latest
27+
timeout-minutes: 60
28+
steps:
29+
- uses: actions/checkout@v6
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Install Dependencies
34+
timeout-minutes: 60
35+
uses: "./.github/steps/install_dependencies"
36+
37+
- name: Build
38+
shell: pwsh
39+
run: dotnet build DotPilot.slnx -warnaserror
40+
41+
unit_tests:
42+
name: Unit Test Suite
43+
runs-on: windows-latest
44+
timeout-minutes: 60
45+
needs:
46+
- build
47+
steps:
48+
- uses: actions/checkout@v6
49+
with:
50+
fetch-depth: 0
51+
52+
- name: Install Dependencies
53+
timeout-minutes: 60
54+
uses: "./.github/steps/install_dependencies"
55+
56+
- name: Run Unit Tests
57+
shell: pwsh
58+
run: dotnet test ./DotPilot.Tests/DotPilot.Tests.csproj --logger GitHubActions --blame-crash
59+
60+
coverage:
61+
name: Coverage Suite
62+
runs-on: windows-latest
63+
timeout-minutes: 60
64+
needs:
65+
- build
66+
steps:
67+
- uses: actions/checkout@v6
68+
with:
69+
fetch-depth: 0
70+
71+
- name: Install Dependencies
72+
timeout-minutes: 60
73+
uses: "./.github/steps/install_dependencies"
74+
75+
- name: Run Coverage
76+
shell: pwsh
77+
run: dotnet test ./DotPilot.Tests/DotPilot.Tests.csproj --settings ./DotPilot.Tests/coverlet.runsettings --logger GitHubActions --blame-crash --collect:"XPlat Code Coverage"
78+
79+
ui_tests:
80+
name: UI Test Suite
81+
runs-on: macos-latest
82+
timeout-minutes: 60
83+
needs:
84+
- build
85+
steps:
86+
- uses: actions/checkout@v6
87+
with:
88+
fetch-depth: 0
89+
90+
- name: Install Dependencies
91+
timeout-minutes: 60
92+
uses: "./.github/steps/install_dependencies"
93+
94+
- name: Run UI Tests
95+
shell: bash
96+
run: |
97+
export UNO_UITEST_DRIVER_PATH="${CHROMEWEBDRIVER}"
98+
export UNO_UITEST_CHROME_BINARY_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
99+
export UNO_UITEST_BROWSER_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
100+
dotnet test ./DotPilot.UITests/DotPilot.UITests.csproj --logger GitHubActions --blame-crash

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)