Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build-samples-datasync-server-cosmosdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Sample - Datasync Server (Cosmos DB)

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
SolutionFile: 'samples/datasync-server-cosmosdb-singlecontainer/Datasync.Server.CosmosDb.SingleContainer.sln'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }}

- name: Build sample
run: >
dotnet build ${{ env.SolutionFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
35 changes: 35 additions & 0 deletions .github/workflows/build-samples-datasync-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Sample - Datasync Server

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
SolutionFile: 'samples/datasync-server/Sample.Datasync.Server.sln'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }}

- name: Build sample
run: >
dotnet build ${{ env.SolutionFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
49 changes: 49 additions & 0 deletions .github/workflows/build-samples-todoapp-avalonia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Sample - TodoApp Avalonia

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# NOTE: This sample's solution (TodoApp.Avalonia.sln) also contains Android and iOS
# heads (net10.0-android / net10.0-ios), which require mobile workloads and are tracked
# separately in https://github.com/CommunityToolkit/Datasync/issues/511 (Phase 3). Only
# the shared and Desktop (net10.0) projects are built directly here, not the full .sln.
SharedProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/TodoApp.Avalonia.csproj'
DesktopProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.Desktop/TodoApp.Avalonia.Desktop.csproj'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore shared project
run: dotnet restore ${{ env.SharedProjectFile }}

- name: Build shared project
run: >
dotnet build ${{ env.SharedProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

- name: Restore desktop project
run: dotnet restore ${{ env.DesktopProjectFile }}

- name: Build desktop project
run: >
dotnet build ${{ env.DesktopProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
35 changes: 35 additions & 0 deletions .github/workflows/build-samples-todoapp-blazor-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Sample - TodoApp Blazor WASM

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
SolutionFile: 'samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.sln'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }}

- name: Build sample
run: >
dotnet build ${{ env.SolutionFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
35 changes: 35 additions & 0 deletions .github/workflows/build-samples-todoapp-mvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Sample - TodoApp MVC

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
SolutionFile: 'samples/todoapp-mvc/part5.sln'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }}

- name: Build sample
run: >
dotnet build ${{ env.SolutionFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
39 changes: 39 additions & 0 deletions .github/workflows/build-samples-todoapp-tutorial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build Sample - TodoApp Tutorial

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# NOTE: This sample's solution (todoapp.sln) also contains ClientApp, a WPF project
# targeting net10.0-windows. That head requires a windows-latest runner and is tracked
# separately in https://github.com/CommunityToolkit/Datasync/issues/510 (Phase 2). Only
# ServerApp (net10.0) is built here.
ProjectFile: 'samples/todoapp-tutorial/ServerApp/ServerApp.csproj'

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.ProjectFile }}

- name: Build sample
run: >
dotnet build ${{ env.ProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
55 changes: 55 additions & 0 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Samples

on:
push:
branches: [ main ]
paths: [ 'samples/**', '.github/workflows/build-samples*.yml' ]
pull_request:
branches: [ main ]
paths: [ 'samples/**', '.github/workflows/build-samples*.yml' ]
workflow_dispatch:

permissions:
contents: read

jobs:
datasync-server:
uses: ./.github/workflows/build-samples-datasync-server.yml

datasync-server-cosmosdb:
uses: ./.github/workflows/build-samples-datasync-server-cosmosdb.yml

todoapp-mvc:
uses: ./.github/workflows/build-samples-todoapp-mvc.yml

todoapp-blazor-wasm:
uses: ./.github/workflows/build-samples-todoapp-blazor-wasm.yml

todoapp-tutorial:
uses: ./.github/workflows/build-samples-todoapp-tutorial.yml

todoapp-avalonia:
uses: ./.github/workflows/build-samples-todoapp-avalonia.yml

# Single aggregation point so branch protection only needs to require one check,
# regardless of how many sample workflows are added over time (see Phase 2/3
# follow-ups: https://github.com/CommunityToolkit/Datasync/issues/510 and #511).
all-samples-built:
name: All samples built
if: always()
needs:
- datasync-server
- datasync-server-cosmosdb
- todoapp-mvc
- todoapp-blazor-wasm
- todoapp-tutorial
- todoapp-avalonia
runs-on: ubuntu-latest
steps:
- name: Check sample build results
run: |
if [ "${{ contains(needs.*.result, 'failure') }}" = "true" ] || [ "${{ contains(needs.*.result, 'cancelled') }}" = "true" ]; then
echo "One or more sample builds failed."
exit 1
fi
echo "All samples built successfully."
Loading