-
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (139 loc) · 5.49 KB
/
ci.yml
File metadata and controls
158 lines (139 loc) · 5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: CI
on:
push:
branches:
- main
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
# The run name, either 'CubeKit PR Validation' if via a PR, or just 'CubeKit CI' if activated another way.
run-name: ${{ github.event_name == 'pull_request' && 'CubeKit PR Validation' || 'CubeKit CI' }}
# Environment variables. No values should be hardcoded, they should all be accessible as an environment variable.
env:
# MSBuild file locations
WORKING_DIR: ${{ github.workspace }}
SOLUTION_PATH: '${{ github.workspace }}\CubeKit.slnx'
HEAD_PROJECTS_DIR: '${{ github.workspace }}\src\platforms'
HEAD_EXTENSIONS_DIR: '${{ github.workspace }}\src\extensions'
# Build configurations and tests
AUTOMATED_TESTS_ARCHITECTURE: 'x64'
AUTOMATED_TESTS_CONFIGURATION: 'Release'
# AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests'
# AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj'
# AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly'
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
# Runner jobs
jobs:
# This is a simple workflow that checks the formatting of XAML.
# XAML is not used in many places in CubeKit, but ensuring that
# it is formatted is imperative nonetheless.
# TODO: Migrate this to a separate workflow in another repository
check-formatting:
name: Check Formatting
if: github.repository_owner == 'RiversideValley'
runs-on: windows-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
- name: Install XamlStyler.Console
run: 'dotnet tool install --global XamlStyler.Console'
- name: Check XAML formatting
id: check-step
run: |
$changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"}
foreach ($file in $changedFiles)
{
xstyler -p -l None -f $file
if ($LASTEXITCODE -ne 0)
{
echo "::error file=$file::Format check failed"
}
}
continue-on-error: true
- name: Fail if necessary
if: steps.check-step.outcome == 'failure'
run: exit 1
build:
name: Build
if: github.repository_owner == 'RiversideValley'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
core: [Riverside.Extensions.Accountability, Riverside.Extensions.PInvoke, Riverside.Extensions.Primitives, Riverside.Extensions.UAP, Riverside.Extensions.Versioning, Riverside.Extensions.WinUI, Riverside.Toolkit.Animations, Riverside.Toolkit.Brushes, Riverside.Toolkit.Controls.Primitives, Riverside.Toolkit.Controls.TitleBar, Riverside.Toolkit.Converters, Riverside.Toolkit.Extensions, Riverside.Toolkit.Helpers, Riverside.Toolkit.Icons, Riverside.Toolkit.Services]
head: [Uno, Wpf, WinUI, Uwp]
exclude: # Exclude known failing configurations
- core: Riverside.Toolkit.Controls.TitleBar
- core: Riverside.Extensions.PInvoke
- core: Riverside.Extensions.UAP
- core: Riverside.Extensions.Versioning
- core: Riverside.Extensions.Accountability
- core: Riverside.Extensions.Primitives
- core: Riverside.Toolkit.Controls.Primitives
head: Wpf
- core: Riverside.Toolkit.Animations
head: Wpf
- core: Riverside.Toolkit.Brushes
head: Wpf
include:
- configuration: Debug
core: Riverside.Extensions.PInvoke
head: NetStandard
- configuration: Debug
core: Riverside.Extensions.UAP
head: NetStandard
- configuration: Debug
core: Riverside.Extensions.Versioning
head: NetStandard
- configuration: Debug
core: Riverside.Extensions.Accountability
head: NetStandard
- configuration: Debug
core: Riverside.Extensions.Primitives
head: NetStandard
- configuration: Release
core: Riverside.Extensions.PInvoke
head: NetStandard
- configuration: Release
core: Riverside.Extensions.UAP
head: NetStandard
- configuration: Release
core: Riverside.Extensions.Versioning
head: NetStandard
- configuration: Release
core: Riverside.Extensions.Accountability
head: NetStandard
- configuration: Release
core: Riverside.Extensions.Primitives
head: NetStandard
- configuration: Debug
core: Riverside.Toolkit.Controls.TitleBar
head: WinUI
- configuration: Release
core: Riverside.Toolkit.Controls.TitleBar
head: WinUI
env:
PROJECT: ${{ matrix.core }}
HEAD: ${{ matrix.head }}
CONFIGURATION: ${{ matrix.configuration }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Build project
shell: pwsh
run: '.github\scripts\BuildProject.ps1 -Project $env:PROJECT -Head $env:HEAD -Configuration $env:CONFIGURATION'