Skip to content

Commit e63d1eb

Browse files
committed
Initial implementation of workspace continuation feature in CI
1 parent 8c21bb5 commit e63d1eb

1 file changed

Lines changed: 45 additions & 124 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
WORKING_DIR: ${{ github.workspace }}
11+
WORKSPACE: ${{ github.workspace }}
1212
GLOBAL_JSON_PATH: '${{ github.workspace }}\global.json'
1313
SOLUTION_PATH: '${{ github.workspace }}\SecureFolderFS.Public.slnx'
1414
SFFS_UNO_PROJECT_PATH: '${{ github.workspace }}\src\Platforms\SecureFolderFS.Uno\SecureFolderFS.Uno.csproj'
@@ -61,9 +61,11 @@ jobs:
6161
matrix:
6262
configuration: [Release, Debug]
6363
project: [NWebDav.Server, NWebDav.Server.HttpListener, Tmds.Fuse]
64+
targetFramework: [net10.0]
6465
env:
6566
CONFIGURATION: ${{ matrix.configuration }}
6667
PROJECT: ${{ matrix.project }}
68+
ID: runtime.lib.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }}
6769

6870
steps:
6971
- name: Checkout the repository
@@ -84,7 +86,7 @@ jobs:
8486
} else {
8587
$thisProject = "Tmds.Fuse"
8688
}
87-
$thisProjectPath = "$env:WORKING_DIR\lib\$thisProject\src\$env:PROJECT"
89+
$thisProjectPath = "$env:WORKSPACE\lib\$thisProject\src\$env:PROJECT"
8890
Add-Content -Path $env:GITHUB_ENV -Value "THIS_PROJECT_PATH=$thisProjectPath"
8991
9092
- name: Restore
@@ -101,11 +103,12 @@ jobs:
101103
-p:Platform="Any CPU" `
102104
-p:Configuration=$env:CONFIGURATION
103105
104-
# - name: Upload artifact
105-
# uses: actions/upload-artifact@v7
106-
# with:
107-
# name: ''
108-
# path: ''
106+
- name: Upload workspace
107+
uses: actions/upload-artifact@v7
108+
with:
109+
name: ${{ env.ID }}
110+
path: ${{ github.workspace }}
111+
retention-days: 1
109112

110113
# Builds the shared libraries consumed by almost all projects in the SecureFolderFS codebase.
111114
shared:
@@ -120,6 +123,7 @@ jobs:
120123
CONFIGURATION: ${{ matrix.configuration }}
121124
PROJECT: ${{ matrix.project }}
122125
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Shared\SecureFolderFS.${{ matrix.project }}
126+
ID: runtime.shared.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }}
123127

124128
steps:
125129
- name: Checkout the repository
@@ -147,11 +151,12 @@ jobs:
147151
-p:Platform="Any CPU" `
148152
-p:Configuration=$env:CONFIGURATION
149153
150-
# - name: Upload artifact
151-
# uses: actions/upload-artifact@v7
152-
# with:
153-
# name: ''
154-
# path: ''
154+
- name: Upload workspace
155+
uses: actions/upload-artifact@v7
156+
with:
157+
name: ${{ env.ID }}
158+
path: ${{ github.workspace }}
159+
retention-days: 1
155160

156161
# Builds the SecureFolderFS SDK libraries.
157162
sdk:
@@ -166,18 +171,14 @@ jobs:
166171
env:
167172
CONFIGURATION: ${{ matrix.configuration }}
168173
PROJECT: ${{ matrix.project }}
174+
ID: runtime.sdk.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }}
175+
PREREQUISITE: runtime.shared.Storage.net10.0.Environment-${{ matrix.configuration }}
169176

170177
steps:
171-
- name: Checkout the repository
172-
uses: actions/checkout@v6
178+
- name: Download workspace
179+
uses: actions/download-artifact@v8
173180
with:
174-
submodules: recursive
175-
176-
- name: Install Dependencies
177-
uses: "./.github/install_dependencies"
178-
with:
179-
dotnet-version: ${{ env.DOTNET_SDK }}
180-
run-uno-check: false
181+
name: ${{ env.PREREQUISITE }}
181182

182183
- name: Find appropriate project to build
183184
run: |
@@ -186,29 +187,16 @@ jobs:
186187
} else {
187188
$thisProject = "Sdk.$env:PROJECT"
188189
}
189-
$thisProjectPath = "$env:WORKING_DIR\src\Sdk\SecureFolderFS.$thisProject"
190+
$thisProjectPath = "$env:WORKSPACE\src\Sdk\SecureFolderFS.$thisProject"
190191
Add-Content -Path $env:GITHUB_ENV -Value "THIS_PROJECT_PATH=$thisProjectPath"
191192
192-
- name: Restore
193-
run: |
194-
msbuild $env:SOLUTION_PATH `
195-
-t:Restore `
196-
-p:Platform="Any CPU" `
197-
-p:Configuration=$env:CONFIGURATION
198-
199193
- name: Build
200194
run: |
201195
msbuild $env:THIS_PROJECT_PATH `
202196
-t:Build `
203197
-p:Platform="Any CPU" `
204198
-p:Configuration=$env:CONFIGURATION
205199
206-
# - name: Upload artifact
207-
# uses: actions/upload-artifact@v7
208-
# with:
209-
# name: ''
210-
# path: ''
211-
212200
# Builds the SecureFolderFS Core libraries.
213201
core:
214202
needs: [shared, lib]
@@ -237,18 +225,14 @@ jobs:
237225
PROJECT: ${{ matrix.project }}
238226
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Core\SecureFolderFS.Core.${{ matrix.project }}
239227
THIS_TFM: ${{ matrix.targetFramework }}
228+
ID: runtime.core.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }}
229+
PREREQUISITE: runtime.shared.Storage.net10.0.Environment-${{ matrix.configuration }}
240230

241231
steps:
242-
- name: Checkout the repository
243-
uses: actions/checkout@v6
232+
- name: Download workspace
233+
uses: actions/download-artifact@v8
244234
with:
245-
submodules: recursive
246-
247-
- name: Install Dependencies
248-
uses: "./.github/install_dependencies"
249-
with:
250-
dotnet-version: ${{ env.DOTNET_SDK }}
251-
run-uno-check: false
235+
name: ${{ env.PREREQUISITE }}
252236

253237
- name: Find appropriate project to build
254238
run: |
@@ -257,16 +241,9 @@ jobs:
257241
} else {
258242
$thisProject = "Core.$env:PROJECT"
259243
}
260-
$thisProjectPath = "$env:WORKING_DIR\src\Core\SecureFolderFS.$thisProject"
244+
$thisProjectPath = "$env:WORKSPACE\src\Core\SecureFolderFS.$thisProject"
261245
Add-Content -Path $env:GITHUB_ENV -Value "THIS_PROJECT_PATH=$thisProjectPath"
262246
263-
- name: Restore
264-
run: |
265-
msbuild $env:SOLUTION_PATH `
266-
-t:Restore `
267-
-p:Platform="Any CPU" `
268-
-p:Configuration=$env:CONFIGURATION
269-
270247
- name: Build
271248
run: |
272249
msbuild $env:THIS_PROJECT_PATH `
@@ -275,12 +252,6 @@ jobs:
275252
-p:Configuration=$env:CONFIGURATION `
276253
-p:TargetFramework=$env:THIS_TFM
277254
278-
# - name: Upload artifact
279-
# uses: actions/upload-artifact@v7
280-
# with:
281-
# name: ''
282-
# path: ''
283-
284255
# Builds the SecureFolderFS cross-platform UI library.
285256
# This library is the common denominator for both the MAUI and Uno Platform project heads.
286257
ui:
@@ -290,30 +261,20 @@ jobs:
290261
fail-fast: false
291262
matrix:
292263
configuration: [Release, Debug]
264+
project: [UI]
293265
targetFramework: [net10.0]
294266
env:
295267
CONFIGURATION: ${{ matrix.configuration }}
296268
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Platforms\SecureFolderFS.UI
297269
THIS_TFM: ${{ matrix.targetFramework }}
270+
ID: runtime.ui.${{ matrix.project }}.${{ matrix.targetFramework }}.Environment-${{ matrix.configuration }}
271+
PREREQUISITE: runtime.sdk.Sdk.net10.0.Environment-${{ matrix.configuration }}
298272

299273
steps:
300-
- name: Checkout the repository
301-
uses: actions/checkout@v6
302-
with:
303-
submodules: recursive
304-
305-
- name: Install Dependencies
306-
uses: "./.github/install_dependencies"
274+
- name: Download workspace
275+
uses: actions/download-artifact@v8
307276
with:
308-
dotnet-version: ${{ env.DOTNET_SDK }}
309-
run-uno-check: false
310-
311-
- name: Restore
312-
run: |
313-
msbuild $env:SOLUTION_PATH `
314-
-t:Restore `
315-
-p:Platform="Any CPU" `
316-
-p:Configuration=$env:CONFIGURATION
277+
name: ${{ env.PREREQUISITE }}
317278

318279
- name: Build
319280
run: |
@@ -322,12 +283,6 @@ jobs:
322283
-p:Platform="Any CPU" `
323284
-p:Configuration=$env:CONFIGURATION
324285
325-
# - name: Upload artifact
326-
# uses: actions/upload-artifact@v7
327-
# with:
328-
# name: ''
329-
# path: ''
330-
331286
# Builds the SecureFolderFS Uno Platform app project head.
332287
uno:
333288
needs: [core, sdk, shared, ui]
@@ -336,30 +291,19 @@ jobs:
336291
fail-fast: false
337292
matrix:
338293
configuration: [Release, Debug]
294+
project: [Uno]
339295
targetFramework: [net10.0-desktop, net10.0-windows10.0.26100.0]
340296
env:
341297
CONFIGURATION: ${{ matrix.configuration }}
342298
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Platforms\SecureFolderFS.Uno
343299
THIS_TFM: ${{ matrix.targetFramework }}
300+
PREREQUISITE: runtime.ui.UI.net10.0.Environment-${{ matrix.configuration }}
344301

345302
steps:
346-
- name: Checkout the repository
347-
uses: actions/checkout@v6
348-
with:
349-
submodules: recursive
350-
351-
- name: Install Dependencies
352-
uses: "./.github/install_dependencies"
303+
- name: Download workspace
304+
uses: actions/download-artifact@v8
353305
with:
354-
dotnet-version: ${{ env.DOTNET_SDK }}
355-
run-uno-check: false
356-
357-
- name: Restore
358-
run: |
359-
msbuild $env:SOLUTION_PATH `
360-
-t:Restore `
361-
-p:Platform="Any CPU" `
362-
-p:Configuration=$env:CONFIGURATION
306+
name: ${{ env.PREREQUISITE }}
363307

364308
- name: Build
365309
run: |
@@ -369,12 +313,6 @@ jobs:
369313
-p:Configuration=$env:CONFIGURATION `
370314
-p:TargetFramework=$env:THIS_TFM
371315
372-
# - name: Upload artifact
373-
# uses: actions/upload-artifact@v7
374-
# with:
375-
# name: ''
376-
# path: ''
377-
378316
# Builds the SecureFolderFS MAUI app project head.
379317
maui:
380318
needs: [core, sdk, shared, ui]
@@ -383,30 +321,19 @@ jobs:
383321
fail-fast: false
384322
matrix:
385323
configuration: [Release, Debug]
324+
project: [Maui]
386325
targetFramework: [net10.0-android, net10.0-ios]
387326
env:
388327
CONFIGURATION: ${{ matrix.configuration }}
389328
THIS_PROJECT_PATH: ${{ github.workspace }}\src\Platforms\SecureFolderFS.Maui
390329
THIS_TFM: ${{ matrix.targetFramework }}
330+
PREREQUISITE: runtime.ui.UI.net10.0.Environment-${{ matrix.configuration }}
391331

392332
steps:
393-
- name: Checkout the repository
394-
uses: actions/checkout@v6
395-
with:
396-
submodules: recursive
397-
398-
- name: Install Dependencies
399-
uses: "./.github/install_dependencies"
333+
- name: Download workspace
334+
uses: actions/download-artifact@v8
400335
with:
401-
dotnet-version: ${{ env.DOTNET_SDK }}
402-
run-uno-check: false
403-
404-
- name: Restore
405-
run: |
406-
msbuild $env:SOLUTION_PATH `
407-
-t:Restore `
408-
-p:Platform="Any CPU" `
409-
-p:Configuration=$env:CONFIGURATION
336+
name: ${{ env.PREREQUISITE }}
410337

411338
- name: Build
412339
run: |
@@ -415,9 +342,3 @@ jobs:
415342
-p:Platform="Any CPU" `
416343
-p:Configuration=$env:CONFIGURATION `
417344
-p:TargetFramework=$env:THIS_TFM
418-
419-
# - name: Upload artifact
420-
# uses: actions/upload-artifact@v7
421-
# with:
422-
# name: ''
423-
# path: ''

0 commit comments

Comments
 (0)