-
Notifications
You must be signed in to change notification settings - Fork 18
154 lines (133 loc) · 4.52 KB
/
ci.yml
File metadata and controls
154 lines (133 loc) · 4.52 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
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
WORKING_DIR: ${{ github.workspace }}
GLOBAL_JSON_PATH: '${{ github.workspace }}\global.json'
SOLUTION_PATH: '${{ github.workspace }}\SecureFolderFS.Public.slnx'
SFFS_UNO_PROJECT_PATH: '${{ github.workspace }}\src\Platforms\SecureFolderFS.Uno\SecureFolderFS.Uno.csproj'
SFFS_MAUI_PROJECT_PATH: '${{ github.workspace }}\src\Platforms\SecureFolderFS.Maui\SecureFolderFS.Maui.csproj'
SFFS_CLI_PROJECT_PATH: '${{ github.workspace }}\src\Platforms\SecureFolderFS.Cli\SecureFolderFS.Cli.csproj'
DOTNET_TFM: 'net10.0'
DOTNET_SDK: '10.0.102'
jobs:
# Ensures that the formatting in all XAML files across the codebase is correct for the latest commit.
formatting:
runs-on: windows-2025-vs2026
steps:
- name: Checkout the repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Setup .NET
uses: actions/setup-dotnet@v5
- name: Install XAML Styler
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
# Builds the external libraries required by SecureFolderFS.
# This ensures that the external dependencies can be built before even attempting the main projects.
lib:
runs-on: windows-2025-vs2026
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
project: [NWebDav.Server, NWebDav.Server.HttpListener, Tmds.Fuse]
env:
CONFIGURATION: ${{ matrix.configuration }}
PROJECT: ${{ matrix.project }}
steps:
- name: Checkout the repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Dependencies
uses: "./.github/install_dependencies"
with:
dotnet-version: ${{ env.DOTNET_SDK }}
run-uno-check: false
- name: Find appropriate project to build
run: |
if ($env:PROJECT -like "NWebDav*") {
$thisProject = "nwebdav"
} else {
$thisProject = "Tmds.Fuse"
}
$thisProjectPath = "$env:WORKING_DIR\lib\$thisProject\src\$env:PROJECT"
Add-Content -Path $env:GITHUB_ENV -Value "THIS_PROJECT_PATH=$thisProjectPath"
- name: Restore
run: |
msbuild $env:SOLUTION_PATH `
-t:Restore `
-p:Platform="Any CPU" `
-p:Configuration=$env:CONFIGURATION
- name: Build
run: |
msbuild $env:THIS_PROJECT_PATH `
-t:Build `
-p:Platform="Any CPU" `
-p:Configuration=$env:CONFIGURATION
# - name: Upload artifact
# uses: actions/upload-artifact@v7
# with:
# name: ''
# path: ''
# Builds the shared libraries consumed by almost all projects in the SecureFolderFS codebase.
shared:
runs-on: windows-2025-vs2026
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
project: [Shared, SourceGenerator, Storage]
targetFramework: [net10.0]
env:
CONFIGURATION: ${{ matrix.configuration }}
PROJECT: ${{ matrix.project }}
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Shared\SecureFolderFS.${{ matrix.project }}
steps:
- name: Checkout the repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Dependencies
uses: "./.github/install_dependencies"
with:
dotnet-version: ${{ env.DOTNET_SDK }}
run-uno-check: false
- name: Restore
run: |
msbuild $env:SOLUTION_PATH `
-t:Restore `
-p:Platform="Any CPU" `
-p:Configuration=$env:CONFIGURATION
- name: Build
run: |
msbuild $env:THIS_PROJECT_PATH `
-t:Build `
-p:Platform="Any CPU" `
-p:Configuration=$env:CONFIGURATION
# - name: Upload artifact
# uses: actions/upload-artifact@v7
# with:
# name: ''
# path: ''