From 65365cc2b98614739a5d2c4056f9f841a86eec01 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sat, 8 Mar 2025 23:43:13 +0100 Subject: [PATCH] Try to run build in parallel. (#1198) * Try to run build in parallel. * Another test * Adjust release * Individual docker files. * Another fix. * Use correct test flags. * Also adapt release.yml * Disable summary. * Fix warnings. * Also disable upload. --- .github/workflows/dev.yml | 282 +++++++++++------- .github/workflows/release.yml | 201 ++++++++++--- .../MySql/Content/Migrations/.editorconfig | 9 + .../Postgres/Content/Migrations/.editorconfig | 9 + .../Content/Migrations/.editorconfig | 9 + .../Squidex.Data.EntityFramework/TableName.cs | 9 +- .../Domain/Contents/Text/EFTextIndexTests.cs | 2 +- tools/TestSuite/docker-compose-base.yml | 4 +- tools/TestSuite/docker-compose-mysql.yml | 54 ++++ tools/TestSuite/docker-compose-postgres.yml | 46 +++ tools/TestSuite/docker-compose-sqlserver.yml | 54 ++++ tools/TestSuite/docker-compose.yml | 177 +---------- 12 files changed, 530 insertions(+), 326 deletions(-) create mode 100644 backend/src/Squidex.Data.EntityFramework/Providers/MySql/Content/Migrations/.editorconfig create mode 100644 backend/src/Squidex.Data.EntityFramework/Providers/Postgres/Content/Migrations/.editorconfig create mode 100644 backend/src/Squidex.Data.EntityFramework/Providers/SqlServer/Content/Migrations/.editorconfig create mode 100644 tools/TestSuite/docker-compose-mysql.yml create mode 100644 tools/TestSuite/docker-compose-postgres.yml create mode 100644 tools/TestSuite/docker-compose-sqlserver.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c6bef16c2..4b639ba4e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -12,193 +12,247 @@ on: - 'release/*' jobs: - build_test: + build: runs-on: ubuntu-latest steps: - name: Prepare - Checkout uses: actions/checkout@v4.2.2 - - name: Prepare - Inject short Variables - uses: rlespinasse/github-slug-action@v5.0.0 + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 - - name: Prepare - Setup QEMU - uses: docker/setup-qemu-action@v3.6.0 + - name: Build + uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + with: + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: squidex-local + + test-containers: + runs-on: ubuntu-latest + needs: build + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Test - TestContainers + run: dotnet test backend/Squidex.sln --filter Category==TestContainers + + test-mongo: + runs-on: ubuntu-latest + needs: build + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 - name: Prepare - Setup Docker Buildx uses: docker/setup-buildx-action@v3.10.0 + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Prepare - Setup Node uses: actions/setup-node@v4.2.0 with: node-version: 18 - - name: Build - BUILD + - name: Build uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + DOCKER_BUILD_SUMMARY: false with: load: true cache-from: type=gha cache-to: type=gha,mode=max tags: squidex-local - - name: Build - TestContainers - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - default_network: host - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/backend/Squidex.sln --filter Category==TestContainers - - - name: Test - Start Compose - if: github.event_name == 'pull_request' + - name: Start Compose run: docker compose up -d working-directory: tools/TestSuite - - name: Test - RUN on Mongo - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8080 - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test1 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated - - - name: Test - RUN on Mongo on path - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8081/squidex - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test5 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated - - - name: Test - RUN on Postgres - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8082 - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test2 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly" - - - name: Test - RUN on MySql - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8083 - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test3 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly" - - - name: Test - RUN on SqlServer - if: github.event_name == 'pull_request' - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8084 - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test4 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly" - - - name: Test - Install Playwright Dependencies - if: github.event_name == 'pull_request' + - name: RUN on Mongo + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8080 + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: RUN on Mongo on path with worker + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8081/squidex + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: Install Playwright Dependencies run: npm ci working-directory: './tools/e2e' - - name: Test - Install Playwright Browsers - if: github.event_name == 'pull_request' + - name: Install Playwright Browsers run: npx playwright install --with-deps working-directory: './tools/e2e' - - name: Test - Run Playwright Tests - if: github.event_name == 'pull_request' + - name: Run Playwright Tests run: npx playwright test --retries=3 working-directory: './tools/e2e' env: BASE__URL: http://localhost:8080 - - name: Test - Upload Playwright Artifacts - if: github.event_name == 'pull_request' && always() + - name: Upload Playwright Artifacts + if: always() uses: actions/upload-artifact@v4.6.1 with: name: playwright-report path: tools/e2e/playwright-report/ retention-days: 30 - - name: Test - Dump docker logs on failure - if: github.event_name == 'pull_request' && failure() + - name: Dump docker logs on failure + if: failure() uses: jwalton/gh-docker-logs@v2.2.2 with: - dest: './docker-logs' + dest: './docker-logs' - - name: Test - Upload docker logs - if: github.event_name == 'pull_request' && failure() + - name: Upload docker logs + if: failure() uses: actions/upload-artifact@v4.6.1 with: - name: docker-logs - path: './docker-logs' + name: docker-logs + path: './docker-logs' - - name: Test - Cleanup - if: github.event_name == 'pull_request' && always() + - name: Cleanup + if: always() run: docker compose down working-directory: tools/TestSuite - - name: Publish - Remove unnecessary files + test-sql: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + include: + - name: mysql + compose: docker-compose-mysql.yml + - name: postgres + compose: docker-compose-postgres.yml + - name: sqlserver + compose: docker-compose-sqlserver.yml + + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 + + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Prepare - Setup Node + uses: actions/setup-node@v4.2.0 + with: + node-version: 18 + + - name: Build + uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + DOCKER_BUILD_SUMMARY: false + with: + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: squidex-local + + - name: Start Compose + run: docker compose -f ${{ matrix.compose }} up -d + working-directory: tools/TestSuite + + - name: RUN on ${{ matrix.name }} + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly" + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8080 + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: Dump docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2.2.2 + with: + dest: './docker-logs' + + - name: Upload docker logs + if: failure() + uses: actions/upload-artifact@v4.6.1 + with: + name: docker-logs-${{ matrix.name }} + path: './docker-logs' + + - name: Cleanup + if: always() + run: docker compose down + working-directory: tools/TestSuite + + publish: + runs-on: ubuntu-latest + needs: [test-containers, test-mongo, test-sql] + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Inject short Variables + uses: rlespinasse/github-slug-action@v5.0.0 + + - name: Prepare - Setup QEMU + uses: docker/setup-qemu-action@v3.6.0 + + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 + + - name: Prepare - Remove unnecessary files run: | sudo rm -rf /usr/share/dotnet sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Publish - Calculate Version + - name: Calculate Version if: github.event_name != 'pull_request' env: BUILD_NUMBER: ${{ github.run_number }} run: | echo "BUILD_NUMBER=$(($BUILD_NUMBER + 6000))" >> $GITHUB_ENV - - name: Publish - Login to Docker Hub + - name: Login to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Publish - Build & Push for Multi-Platforms + - name: Build & Push for Multi-Platforms if: github.event_name != 'pull_request' uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false with: + push: true build-args: "SQUIDEX__RUNTIME__VERSION=7.0.0-dev-${{ env.BUILD_NUMBER }}" cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 tags: squidex/squidex:dev,squidex/squidex:dev-${{ env.BUILD_NUMBER }} - push: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc5345914..f9bf09921 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,68 +7,106 @@ on: - "*" jobs: - build_test: + build: runs-on: ubuntu-latest steps: - name: Prepare - Checkout uses: actions/checkout@v4.2.2 - - name: Prepare - Inject short Variables - uses: rlespinasse/github-slug-action@v5.0.0 + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 - - name: Prepare - Setup QEMU - uses: docker/setup-qemu-action@v3.6.0 + - name: Build + uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + with: + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: squidex-local + + test-containers: + runs-on: ubuntu-latest + needs: build + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Test - TestContainers + run: dotnet test backend/Squidex.sln --filter Category==TestContainers + + test-mongo: + runs-on: ubuntu-latest + needs: build + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 - name: Prepare - Setup Docker Buildx uses: docker/setup-buildx-action@v3.10.0 + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Prepare - Setup Node uses: actions/setup-node@v4.2.0 with: node-version: 18 - - name: Build - BUILD + - name: Build uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + DOCKER_BUILD_SUMMARY: false with: load: true - build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" cache-from: type=gha cache-to: type=gha,mode=max tags: squidex-local - - name: Test - Start Compose + - name: Start Compose run: docker compose up -d working-directory: tools/TestSuite - - name: Test - RUN - uses: kohlerdominik/docker-run-action@v2.0.0 - with: - image: mcr.microsoft.com/dotnet/sdk:8.0 - environment: | - CONFIG__BACKUPURL=http://localhost:5000 - CONFIG__WAIT=60 - CONFIG__SERVER__URL=http://localhost:8080 - WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher - default_network: host - options: --name test1 - volumes: ${{ github.workspace }}:/src - run: dotnet test /src/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated - - - name: Test - Install Playwright Dependencies + - name: RUN on Mongo + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8080 + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: RUN on Mongo on path with worker + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8081/squidex + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: Install Playwright Dependencies run: npm ci working-directory: './tools/e2e' - - name: Test - Install Playwright Browsers + - name: Install Playwright Browsers run: npx playwright install --with-deps working-directory: './tools/e2e' - - name: Test - Run Playwright Tests + - name: Run Playwright Tests run: npx playwright test --retries=3 working-directory: './tools/e2e' env: BASE__URL: http://localhost:8080 - - name: Test - Upload Playwright Artifacts + - name: Upload Playwright Artifacts if: always() uses: actions/upload-artifact@v4.6.1 with: @@ -76,51 +114,140 @@ jobs: path: tools/e2e/playwright-report/ retention-days: 30 - - name: Test - Dump docker logs on failure + - name: Dump docker logs on failure + if: failure() + uses: jwalton/gh-docker-logs@v2.2.2 + with: + dest: './docker-logs' + + - name: Upload docker logs + if: failure() + uses: actions/upload-artifact@v4.6.1 + with: + name: docker-logs + path: './docker-logs' + + - name: Cleanup + if: always() + run: docker compose down + working-directory: tools/TestSuite + + test-sql: + runs-on: ubuntu-latest + needs: build + strategy: + matrix: + include: + - name: mysql + compose: docker-compose-mysql.yml + - name: postgres + compose: docker-compose-postgres.yml + - name: sqlserver + compose: docker-compose-sqlserver.yml + + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 + + - name: Prepare - Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Prepare - Setup Node + uses: actions/setup-node@v4.2.0 + with: + node-version: 18 + + - name: Build + uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + DOCKER_BUILD_SUMMARY: false + with: + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: squidex-local + + - name: Start Compose + run: docker compose -f ${{ matrix.compose }} up -d + working-directory: tools/TestSuite + + - name: RUN on ${{ matrix.name }} + run: dotnet test tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter "Category!=NotAutomated & Category!=MongoOnly" + env: + CONFIG__BACKUPURL: http://localhost:5000 + CONFIG__WAIT: 60 + CONFIG__SERVER__URL: http://localhost:8080 + WEBHOOKCATCHER__HOST__ENDPOINT: webhookcatcher + + - name: Dump docker logs on failure if: failure() uses: jwalton/gh-docker-logs@v2.2.2 with: - dest: './docker-logs' + dest: './docker-logs' - - name: Test - Upload docker logs + - name: Upload docker logs if: failure() uses: actions/upload-artifact@v4.6.1 with: - name: docker-logs - path: './docker-logs' + name: docker-logs-${{ matrix.name }} + path: './docker-logs' - - name: Test - Cleanup + - name: Cleanup if: always() run: docker compose down working-directory: tools/TestSuite + + publish: + runs-on: ubuntu-latest + needs: [test-containers, test-mongo, test-sql] + steps: + - name: Prepare - Checkout + uses: actions/checkout@v4.2.2 + + - name: Prepare - Inject short Variables + uses: rlespinasse/github-slug-action@v5.0.0 - - name: Publish - Remove unnecessary files + - name: Prepare - Setup QEMU + uses: docker/setup-qemu-action@v3.6.0 + + - name: Prepare - Setup Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 + + - name: Prepare - Remove unnecessary files run: | sudo rm -rf /usr/share/dotnet sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Publish - Get Major Version + - name: Version - Calculate Major id: version uses: rishabhgupta/split-by@v1.0.1 with: string: "${{ env.GITHUB_REF_SLUG }}" split-by: "." - - name: Publish - Check Tag + - name: Version - Check Tag id: normal-version run: | if [[ ${{ env.GITHUB_REF_SLUG }} =~ ^[0-9]+\.[0-9]+(\.[0-9]+){0,2}$ ]]; then echo "STABLE_VERSION=true" >> $GITHUB_ENV fi - - name: Publish - Login to Docker Hub + - name: Login to Docker Hub uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Publish - Build & Push for Multi-Platforms + - name: Build & Push for Multi-Platforms uses: docker/build-push-action@v6.15.0 + env: + DOCKER_BUILD_RECORD_UPLOAD: false with: build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" cache-from: type=gha diff --git a/backend/src/Squidex.Data.EntityFramework/Providers/MySql/Content/Migrations/.editorconfig b/backend/src/Squidex.Data.EntityFramework/Providers/MySql/Content/Migrations/.editorconfig new file mode 100644 index 000000000..1e79455e5 --- /dev/null +++ b/backend/src/Squidex.Data.EntityFramework/Providers/MySql/Content/Migrations/.editorconfig @@ -0,0 +1,9 @@ +[*.cs] +# MA0007: Add a comma after the last value +dotnet_diagnostic.MA0007.severity = none + +# MA0048: File name must match type name +dotnet_diagnostic.MA0048.severity = none + +# SA1633: File must have header +dotnet_diagnostic.SA1633.severity = none \ No newline at end of file diff --git a/backend/src/Squidex.Data.EntityFramework/Providers/Postgres/Content/Migrations/.editorconfig b/backend/src/Squidex.Data.EntityFramework/Providers/Postgres/Content/Migrations/.editorconfig new file mode 100644 index 000000000..1e79455e5 --- /dev/null +++ b/backend/src/Squidex.Data.EntityFramework/Providers/Postgres/Content/Migrations/.editorconfig @@ -0,0 +1,9 @@ +[*.cs] +# MA0007: Add a comma after the last value +dotnet_diagnostic.MA0007.severity = none + +# MA0048: File name must match type name +dotnet_diagnostic.MA0048.severity = none + +# SA1633: File must have header +dotnet_diagnostic.SA1633.severity = none \ No newline at end of file diff --git a/backend/src/Squidex.Data.EntityFramework/Providers/SqlServer/Content/Migrations/.editorconfig b/backend/src/Squidex.Data.EntityFramework/Providers/SqlServer/Content/Migrations/.editorconfig new file mode 100644 index 000000000..1e79455e5 --- /dev/null +++ b/backend/src/Squidex.Data.EntityFramework/Providers/SqlServer/Content/Migrations/.editorconfig @@ -0,0 +1,9 @@ +[*.cs] +# MA0007: Add a comma after the last value +dotnet_diagnostic.MA0007.severity = none + +# MA0048: File name must match type name +dotnet_diagnostic.MA0048.severity = none + +# SA1633: File must have header +dotnet_diagnostic.SA1633.severity = none \ No newline at end of file diff --git a/backend/src/Squidex.Data.EntityFramework/TableName.cs b/backend/src/Squidex.Data.EntityFramework/TableName.cs index d11a27c73..554bbede4 100644 --- a/backend/src/Squidex.Data.EntityFramework/TableName.cs +++ b/backend/src/Squidex.Data.EntityFramework/TableName.cs @@ -1,4 +1,11 @@ -namespace Squidex; +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex; public static class TableName { diff --git a/backend/tests/Squidex.Data.Tests/EntityFramework/Domain/Contents/Text/EFTextIndexTests.cs b/backend/tests/Squidex.Data.Tests/EntityFramework/Domain/Contents/Text/EFTextIndexTests.cs index 48e428c29..f6889fcf0 100644 --- a/backend/tests/Squidex.Data.Tests/EntityFramework/Domain/Contents/Text/EFTextIndexTests.cs +++ b/backend/tests/Squidex.Data.Tests/EntityFramework/Domain/Contents/Text/EFTextIndexTests.cs @@ -12,7 +12,7 @@ using Squidex.Infrastructure; namespace Squidex.EntityFramework.Domain.Contents.Text; -public abstract class EFTextIndexTests(ISqlFixture fixture) : TextIndexerTests +public abstract class EFTextIndexTests(ISqlFixture fixture) : TextIndexerTests where TContext : DbContext, IDbContextWithDialect { public override bool SupportsQuerySyntax => false; diff --git a/tools/TestSuite/docker-compose-base.yml b/tools/TestSuite/docker-compose-base.yml index 0cb034b0c..35bc074aa 100644 --- a/tools/TestSuite/docker-compose-base.yml +++ b/tools/TestSuite/docker-compose-base.yml @@ -19,6 +19,4 @@ services: - STORE__MONGODB__CONFIGURATION=mongodb://db_mongo - TEMPLATES__LOCALURL=http://localhost:5000 - UI__HIDENEWS=true - - UI__HIDEONBOARDING=true - networks: - - internal \ No newline at end of file + - UI__HIDEONBOARDING=true \ No newline at end of file diff --git a/tools/TestSuite/docker-compose-mysql.yml b/tools/TestSuite/docker-compose-mysql.yml new file mode 100644 index 000000000..c7843c410 --- /dev/null +++ b/tools/TestSuite/docker-compose-mysql.yml @@ -0,0 +1,54 @@ +services: + db_mysql: + image: mysql + ports: + - "3306:3306" + environment: + - MYSQL_DATABASE=squidex + - MYSQL_USER=admin + - MYSQL_PASSWORD=secret + - MYSQL_ROOT_PASSWORD=secret + command: --log-bin-trust-function-creators=1 --local-infile=1 + volumes: + - mysql_data:/var/lib/mysql + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "admin", "--password=secret"] + interval: 10s + retries: 10 + + squidex_mysql: + extends: + file: docker-compose-base.yml + service: squidex_base + environment: + - EVENTSTORE__TYPE=Sql + - STORE__TYPE=Sql + - STORE__SQL__CONNECTIONSTRING=Server=db_mysql;Port=3306;Database=squidex;User=admin;Password=secret;AllowLoadLocalInfile=true; + - STORE__SQL__PROVIDER=MySql + - STORE__SQL__VERSION=9.2.0-mysql + - MESSAGING__TYPE=Sql + - URLS__BASEURL=http://localhost:8080 + depends_on: + db_mysql: + condition: service_healthy + + proxy_mysql: + image: squidex/caddy-proxy-path:2.6.2 + ports: + - "8080:8080" + environment: + - SITE_ADDRESS=http://localhost:8080 + - SITE_PATH=* + - SITE_SERVER="squidex_mysql:5000" + depends_on: + - squidex_mysql + restart: unless-stopped + + webhookcatcher: + image: tarampampam/webhook-tester:2 + command: serve --port 1026 + ports: + - "1026:1026" + +volumes: + mysql_data: \ No newline at end of file diff --git a/tools/TestSuite/docker-compose-postgres.yml b/tools/TestSuite/docker-compose-postgres.yml new file mode 100644 index 000000000..dcd05295b --- /dev/null +++ b/tools/TestSuite/docker-compose-postgres.yml @@ -0,0 +1,46 @@ +services: + db_postgres: + image: "postgis/postgis" + ports: + - "5432:5432" + environment: + - POSTGRES_USER=admin + - POSTGRES_PASSWORD=secret + - POSTGRES_DB=squidex + healthcheck: + test: ["CMD-SHELL", "pg_isready -U admin"] + interval: 10s + retries: 10 + + squidex_postgres: + extends: + file: docker-compose-base.yml + service: squidex_base + environment: + - EVENTSTORE__TYPE=Sql + - STORE__TYPE=Sql + - STORE__SQL__CONNECTIONSTRING=Server=db_postgres;Port=5432;Database=squidex;Pooling=true;Username=admin;Password=secret;SSL Mode=Disable; + - STORE__SQL__PROVIDER=Postgres + - MESSAGING__TYPE=Sql + - URLS__BASEURL=http://localhost:8080 + depends_on: + db_postgres: + condition: service_healthy + + proxy_postgres: + image: squidex/caddy-proxy-path:2.6.2 + ports: + - "8080:8080" + environment: + - SITE_ADDRESS=http://localhost:8080 + - SITE_PATH=* + - SITE_SERVER="squidex_postgres:5000" + depends_on: + - squidex_postgres + restart: unless-stopped + + webhookcatcher: + image: tarampampam/webhook-tester:2 + command: serve --port 1026 + ports: + - "1026:1026" \ No newline at end of file diff --git a/tools/TestSuite/docker-compose-sqlserver.yml b/tools/TestSuite/docker-compose-sqlserver.yml new file mode 100644 index 000000000..682f30df9 --- /dev/null +++ b/tools/TestSuite/docker-compose-sqlserver.yml @@ -0,0 +1,54 @@ +services: + db_sqlserver: + image: squidex/mssql-dev:2 + ports: + - "1433:1433" + environment: + - SA_PASSWORD=1q2w3e!R + - SA_USER=none + - ACCEPT_EULA=Y + healthcheck: + test: ["CMD-SHELL", "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 1q2w3e!R -Q 'SELECT 1'"] + interval: 10s + retries: 10 + + db_sqlserver_init: + image: mcr.microsoft.com/mssql-tools + entrypoint: > + /opt/mssql-tools/bin/sqlcmd -S db_sqlserver -U sa -P 1q2w3e!R -d master -Q 'CREATE DATABASE ''squidex''' + depends_on: + db_sqlserver: + condition: service_healthy + + squidex_sqlserver: + extends: + file: docker-compose-base.yml + service: squidex_base + environment: + - EVENTSTORE__TYPE=Sql + - STORE__TYPE=Sql + - STORE__SQL__CONNECTIONSTRING=Server=db_sqlserver;Database=squidex;User=sa;Password=1q2w3e!R;TrustServerCertificate=True; + - STORE__SQL__PROVIDER=SqlServer + - MESSAGING__TYPE=Sql + - URLS__BASEURL=http://localhost:8080 + depends_on: + db_sqlserver: + condition: service_healthy + + proxy_sqlserver: + image: squidex/caddy-proxy-path:2.6.2 + ports: + - "8080:8080" + environment: + - SITE_ADDRESS=http://localhost:8080 + - SITE_PATH=* + - SITE_SERVER="squidex_sqlserver:5000" + depends_on: + - squidex_sqlserver + restart: unless-stopped + + webhookcatcher: + image: tarampampam/webhook-tester:2 + command: serve --port 1026 + ports: + - "1026:1026" \ No newline at end of file diff --git a/tools/TestSuite/docker-compose.yml b/tools/TestSuite/docker-compose.yml index 90af7c93a..9b97717f8 100644 --- a/tools/TestSuite/docker-compose.yml +++ b/tools/TestSuite/docker-compose.yml @@ -3,67 +3,6 @@ services: image: mongo ports: - "27019:27017" - networks: - - internal - - db_postgres: - image: "postgis/postgis" - ports: - - "5432:5432" - environment: - - POSTGRES_USER=admin - - POSTGRES_PASSWORD=secret - - POSTGRES_DB=squidex - networks: - - internal - healthcheck: - test: ["CMD-SHELL", "pg_isready -U admin"] - interval: 10s - retries: 10 - - db_mysql: - image: mysql - ports: - - "3306:3306" - environment: - - MYSQL_DATABASE=squidex - - MYSQL_USER=admin - - MYSQL_PASSWORD=secret - - MYSQL_ROOT_PASSWORD=secret - command: --log-bin-trust-function-creators=1 --local-infile=1 - volumes: - - mysql_data:/var/lib/mysql - networks: - - internal - healthcheck: - test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "admin", "--password=secret"] - interval: 10s - retries: 10 - - db_sqlserver: - image: squidex/mssql-dev:2 - ports: - - "1433:1433" - environment: - - SA_PASSWORD=1q2w3e!R - - SA_USER=none - - ACCEPT_EULA=Y - networks: - - internal - healthcheck: - test: ["CMD-SHELL", "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 1q2w3e!R -Q 'SELECT 1'"] - interval: 10s - retries: 10 - - db_sqlserver_init: - image: mcr.microsoft.com/mssql-tools - entrypoint: > - /opt/mssql-tools/bin/sqlcmd -S db_sqlserver -U sa -P 1q2w3e!R -d master -Q 'CREATE DATABASE ''squidex''' - networks: - - internal - depends_on: - db_sqlserver: - condition: service_healthy # Base configuration squidex_mongo: @@ -71,6 +10,7 @@ services: file: docker-compose-base.yml service: squidex_base environment: + - ASSETS__RESIZERURL=http://resizer - EVENTSTORE__MONGODB__DATABASE=squidex1 - STORE__MONGODB__CONTENTDATABASE=squidex1_content - STORE__MONGODB__DATABASE=squidex1 @@ -110,65 +50,6 @@ services: depends_on: - db_mongo - squidex_postgres: - extends: - file: docker-compose-base.yml - service: squidex_base - environment: - - EVENTSTORE__TYPE=Sql - - STORE__TYPE=Sql - - STORE__SQL__CONNECTIONSTRING=Server=db_postgres;Port=5432;Database=squidex;Pooling=true;Username=admin;Password=secret;SSL Mode=Disable; - - STORE__SQL__PROVIDER=Postgres - - MESSAGING__TYPE=Sql - - URLS__BASEURL=http://localhost:8082 - depends_on: - db_postgres: - condition: service_healthy - - squidex_mysql: - extends: - file: docker-compose-base.yml - service: squidex_base - environment: - - EVENTSTORE__TYPE=Sql - - STORE__TYPE=Sql - - STORE__SQL__CONNECTIONSTRING=Server=db_mysql;Port=3306;Database=squidex;User=admin;Password=secret;AllowLoadLocalInfile=true; - - STORE__SQL__PROVIDER=MySql - - STORE__SQL__VERSION=9.2.0-mysql - - MESSAGING__TYPE=Sql - - URLS__BASEURL=http://localhost:8083 - depends_on: - db_mysql: - condition: service_healthy - - squidex_sqlserver: - extends: - file: docker-compose-base.yml - service: squidex_base - environment: - - EVENTSTORE__TYPE=Sql - - STORE__TYPE=Sql - - STORE__SQL__CONNECTIONSTRING=Server=db_sqlserver;Database=squidex;User=sa;Password=1q2w3e!R;TrustServerCertificate=True; - - STORE__SQL__PROVIDER=SqlServer - - MESSAGING__TYPE=Sql - - URLS__BASEURL=http://localhost:8084 - depends_on: - db_sqlserver: - condition: service_healthy - - resizer: - image: squidex/resizer:1.3.0 - networks: - - internal - - webhookcatcher: - image: tarampampam/webhook-tester:2 - command: serve --port 1026 - ports: - - "1026:1026" - networks: - - internal - proxy_mongo: image: squidex/caddy-proxy:2.6.2 ports: @@ -179,8 +60,6 @@ services: - SITE_SERVER="squidex_mongo:5000" depends_on: - squidex_mongo - networks: - - internal restart: unless-stopped proxy_mongo_path: @@ -193,55 +72,13 @@ services: - SITE_SERVER="squidex_mongo_path:5000" depends_on: - squidex_mongo_path - networks: - - internal restart: unless-stopped - proxy_postgres: - image: squidex/caddy-proxy-path:2.6.2 - ports: - - "8082:8082" - environment: - - SITE_ADDRESS=http://localhost:8082 - - SITE_PATH=* - - SITE_SERVER="squidex_postgres:5000" - depends_on: - - squidex_postgres - networks: - - internal - restart: unless-stopped - - proxy_mysql: - image: squidex/caddy-proxy-path:2.6.2 - ports: - - "8083:8083" - environment: - - SITE_ADDRESS=http://localhost:8083 - - SITE_PATH=* - - SITE_SERVER="squidex_mysql:5000" - depends_on: - - squidex_mysql - networks: - - internal - restart: unless-stopped + resizer: + image: squidex/resizer:1.3.0 - proxy_sqlserver: - image: squidex/caddy-proxy-path:2.6.2 + webhookcatcher: + image: tarampampam/webhook-tester:2 + command: serve --port 1026 ports: - - "8084:8084" - environment: - - SITE_ADDRESS=http://localhost:8084 - - SITE_PATH=* - - SITE_SERVER="squidex_sqlserver:5000" - depends_on: - - squidex_sqlserver - networks: - - internal - restart: unless-stopped - -networks: - internal: - driver: bridge - -volumes: - mysql_data: \ No newline at end of file + - "1026:1026" \ No newline at end of file