diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 2d84b767f..d8466bdb8 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -8,7 +8,8 @@ on: jobs: production-deploy: - runs-on: ubuntu-26.04 + runs-on: ubuntu-latest + steps: # 1. Récupération du code - name: Check out the repo @@ -24,24 +25,8 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 10.0.x - - name: Workloads restore - run: dotnet workload restore - name: Test - env: - TEST_FAILED: "" - run: make test || export TEST_FAILED=$? - - uses: actions/upload-artifact@v7 - with: - name: my-artifact - path: test-reports/**/* - - name: Fail if tests failed - if: ${{ env.TEST_FAILED != '' && env.TEST_FAILED != '0' }} - run: exit $TEST_FAILED - + run: dotnet test --no-build --verbosity normal --filter="Category!=Platform-Android" # 4. Build et Push de l'image de production finale - name: Build and push production image uses: docker/build-push-action@v7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3320ee74f..946ee328f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,11 +29,6 @@ ### Fixed -* [PostIt.Tests] Les tests du bandeau de session utilisent le bandeau - réellement monté dans la fenêtre headless, au lieu d'un contrôle détaché. - Les fenêtres sont fermées après chaque test et les quatre boutons - de navigation sont vérifiés. - * [PostIt] Les liens Markdown des pièces jointes utilisent désormais le même filtre de nom que l'upload serveur, avant l'encodage URL. Le libellé conserve le nom original, notamment ses accents. diff --git a/Dockerfile.backend b/Dockerfile.backend index 46c9a982e..a4e9a54a9 100644 --- a/Dockerfile.backend +++ b/Dockerfile.backend @@ -1,12 +1,36 @@ # Utilisation de l'image globale pour le build et l'exécution -FROM pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 AS build-env +FROM pazof/yavsc-build-env:debian12-dotnet10-android36-v1 AS build-env WORKDIR /src + # 1. Copie de la solution +COPY *.sln ./ +COPY Directory.*.props ./ + +# 2. Copie de l'intégralité des fichiers de projets (.csproj) pour la restauration +COPY src/Yavsc.Org/*.csproj ./src/Yavsc.Org/ +COPY src/Yavsc.Abstract/*.csproj ./src/Yavsc.Abstract/ +COPY src/Yavsc.Server/*.csproj ./src/Yavsc.Server/ +COPY src/Yavsc.Api/*.csproj ./src/Yavsc.Api/ +COPY src/Yavsc.Blogs/*.csproj ./src/Yavsc.Blogs/ +COPY src/cli/*.csproj ./src/cli/ +COPY src/Yavsc.Org.Tests/*.csproj ./src/Yavsc.Org.Tests/ + +# Projets associés à PostIt +COPY src/PostIt/PostIt/*.csproj ./src/PostIt/PostIt/ +COPY src/PostIt/PostIt.Android/*.csproj ./src/PostIt/PostIt.Android/ +COPY src/PostIt/PostIt.Browser/*.csproj ./src/PostIt/PostIt.Browser/ +COPY src/PostIt/PostIt.Desktop/*.csproj ./src/PostIt/PostIt.Desktop/ + +# 4. Copie de l'intégralité du code source COPY . . -RUN dotnet workload restore + # 4. Restauration des dépendances pour tous les projets RUN dotnet restore + +# 5. Copie de la totalité du code source (filtrée par votre .dockerignore) +COPY . . + # 6. Compilation du serveur Web principal RUN dotnet build src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-restore -clp:ErrorsOnly diff --git a/Makefile b/Makefile index 04efba0be..1893a910e 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ DESTDIR=/tmp/yavsc APP_PATH=srv/www/yavsc APP_FULL_PATH=$(DESTDIR)/$(APP_PATH) +include .env + all: dotnet build --nologo diff --git a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs index f53fffd9a..3516e93d6 100644 --- a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs +++ b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs @@ -1,5 +1,6 @@ using Avalonia.Controls; using Avalonia.Headless.XUnit; +using Avalonia.Styling; using Avalonia.VisualTree; using PostIt.ViewModels; using PostIt.Views; @@ -22,36 +23,41 @@ namespace PostIt.Tests; /// new Window().Show() throws because the harness has not /// been initialised for that thread. /// -/// These tests set the DataContext directly on the banner -/// mounted in the window. The production code path is exercised +/// The session banner's DataContext is not wired in +/// these tests: App.OnFrameworkInitializationCompleted is +/// not called in a unit test, so we set the DataContext on the +/// banner directly. The production code path is exercised /// end-to-end by the manual launch, not here. /// -public class SessionStatusBannerTests : IDisposable +public class SessionStatusBannerTests { - private MainWindow? _window; - [AvaloniaFact] - public void Banner_renders_four_buttons_in_the_visual_tree() + public void Banner_renders_three_buttons_in_the_visual_tree() { - SessionStatusBanner banner = CreateBanner(); + MainWindow window = new MainWindow(); + window.Show(); - var buttons = banner.GetVisualDescendants() + var buttons = window.GetVisualDescendants() .OfType