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
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Git
.git
.gitignore

# Task / planning files
task.md
.claude/

# IDE & build outputs
.vs/
.idea/
*.user
**/bin/
**/obj/

# SQLite databases
*.db
*.db-shm
*.db-wal

# Test results
TestResults/
*.trx
*.coverage

# Docker
Dockerfile
.dockerignore

76 changes: 34 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
buildConfiguration: Release

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.x'

# Build only the test projects (pulls in DAL/BL as dependencies automatically,
# skips GameLib.App since that needs MAUI workloads we don't want on free CI runners)
- name: Build backend & tests
run: |
dotnet build solution/GameLib.Tests/GameLib.DAL.Tests.csproj --configuration $buildConfiguration
dotnet build solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj --configuration $buildConfiguration

# GameLib.Common.Tests is shared seed/assert data referenced by the two suites
# above (built transitively) - it has no tests of its own, so it's not run here.
- name: Run DAL tests
run: dotnet test solution/GameLib.Tests/GameLib.DAL.Tests.csproj --configuration $buildConfiguration --logger trx --no-build

- name: Run BL tests
run: dotnet test solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj --configuration $buildConfiguration --logger trx --no-build
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build test image (runs xUnit tests inside)
uses: docker/build-push-action@v6
with:
context: .
target: test
push: false
# Layer cache shared across runs via GitHub Actions cache
cache-from: type=gha,scope=test
cache-to: type=gha,mode=max,scope=test
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# syntax=docker/dockerfile:1
# ============================================================
# Stage: test
# Restores, builds, and runs the DAL + BL xUnit test suites.
# Usage: docker build --target test .
# ============================================================
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS test

ENV DOTNET_NOLOGO=true \
DOTNET_CLI_TELEMETRY_OPTOUT=true

WORKDIR /src

# Copy project files first — layer cache is invalidated only when these
# change, so a source-only edit doesn't re-trigger a full restore.
COPY solution/GameLib.DAL/GameLib.DAL.csproj ./solution/GameLib.DAL/
COPY solution/GameLib.BL/GameLib.BL.csproj ./solution/GameLib.BL/
COPY solution/GameLib.Common.Tests/GameLib.Common.Tests.csproj ./solution/GameLib.Common.Tests/
COPY solution/GameLib.Tests/GameLib.DAL.Tests.csproj ./solution/GameLib.Tests/
COPY solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj ./solution/GameLib.BL.Tests/

RUN dotnet restore solution/GameLib.Tests/GameLib.DAL.Tests.csproj && \
dotnet restore solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj

# Copy the full source tree
COPY solution/ ./solution/

RUN dotnet build solution/GameLib.Tests/GameLib.DAL.Tests.csproj \
--no-restore --configuration Release && \
dotnet build solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj \
--no-restore --configuration Release

# Tests run during the image build — the build fails fast if any test fails.
RUN dotnet test solution/GameLib.Tests/GameLib.DAL.Tests.csproj \
--no-build --configuration Release \
--logger "console;verbosity=normal" && \
dotnet test solution/GameLib.BL.Tests/GameLib.BL.Tests.csproj \
--no-build --configuration Release \
--logger "console;verbosity=normal"
5 changes: 1 addition & 4 deletions solution/GameLib.App/GameLib.App.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net10.0-android</TargetFrameworks>
Expand Down Expand Up @@ -101,9 +101,6 @@
<MauiXaml Update="Views\GameAddView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\LibraryGameDetailView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\LibraryView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
Expand Down
64 changes: 0 additions & 64 deletions solution/GameLib.App/Views/GameEditView.xaml

This file was deleted.

23 changes: 0 additions & 23 deletions solution/GameLib.App/Views/GameEditView.xaml.cs

This file was deleted.

12 changes: 0 additions & 12 deletions solution/GameLib.App/Views/LibraryGameDetailView.xaml

This file was deleted.

9 changes: 0 additions & 9 deletions solution/GameLib.App/Views/LibraryGameDetailView.xaml.cs

This file was deleted.

Loading