From 29dea37bf7860df964c6e57f71044ac132b3c69e Mon Sep 17 00:00:00 2001 From: Martin Medek Date: Thu, 19 Dec 2024 12:57:37 +0100 Subject: [PATCH] fixing review comments --- .github/workflows/ci.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6b1e1..6c0463c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,9 +31,7 @@ env: XBK_DIR: "${{ github.workspace }}\\xbk" UMT_DIR: "${{ github.workspace }}\\umt" DB_USER: "kentico" - DB_PASSWORD: "Asdfg12345!@#$%" DB_DATABASE: "pwtest" - XBK_ADMIN_PASSWORD: "admin" LICENSE_FILE: "${{ github.workspace }}\\license.txt" XBK_URL: "" SQLSERVER_NAME: ".\\SQLEXPRESS" @@ -53,12 +51,6 @@ jobs: with: global-json-file: "${{ env.UMT_DIR}}\\global.json" - - name: Install dependencies and build - working-directory: ${{ env.UMT_DIR }} - run: | - dotnet restore --locked-mode - dotnet tool restore - - name: Install SQL Server uses: Particular/install-sql-server-action@v1.0.0 with: @@ -67,7 +59,7 @@ jobs: - name: Create Kentico DB user run: | - sqlcmd -Q "CREATE LOGIN ${{ env.DB_USER}} WITH PASSWORD = '${{ env.DB_PASSWORD }}'; + sqlcmd -Q "CREATE LOGIN ${{ env.DB_USER}} WITH PASSWORD = '${{ secrets.XPERIENCE_BY_KENTICO_DB_PASSWORD }}'; CREATE USER kentico FOR LOGIN kentico; GO" @@ -83,13 +75,9 @@ jobs: Write-Output "SQL Server: Forcing Restart of Instance." Restart-Service -Force 'MSSQL$SQLEXPRESS' - - name: Create database with collation Latin1_General_CI_AS - run: | - sqlcmd -S "${{ env.SQLSERVER_NAME}}" -U '${{ env.DB_USER}}' -P '${{ env.DB_PASSWORD }}' -Q "CREATE DATABASE ${{ env.DB_DATABASE}} COLLATE Latin1_General_CI_AS;" - - - name: Test SQL Server login as admin + - name: Create database run: | - sqlcmd -S "${{ env.SQLSERVER_NAME}}" -U '${{ env.DB_USER}}' -P '${{ env.DB_PASSWORD }}' -Q "SELECT 'Login successful' AS Message" + sqlcmd -S "${{ env.SQLSERVER_NAME}}" -U '${{ env.DB_USER}}' -P '${{ secrets.XPERIENCE_BY_KENTICO_DB_PASSWORD }}' -Q "CREATE DATABASE ${{ env.DB_DATABASE}} COLLATE Latin1_General_CI_AS;" - name: Install kentico templates working-directory: ${{ env.UMT_DIR }} @@ -109,8 +97,8 @@ jobs: run: | echo ${{ secrets.XPERIENCE_BY_KENTICO_LICENSE }} > ${{ env.LICENSE_FILE }} Write-Output "SQL_SERVER_CONNECTION_STRING: $env:SQL_SERVER_CONNECTION_STRING" - dotnet kentico-xperience-dbmanager -- -s "${{ env.SQLSERVER_NAME}}" -d "${{ env.DB_DATABASE }}" -u "${{ env.DB_USER }}" -p "${{ env.DB_PASSWORD }}" -a "${{ env.XBK_ADMIN_PASSWORD }}" --license-file "${{ env.LICENSE_FILE }}" --use-existing-database --hash-string-salt "" - sqlcmd -S "${{ env.SQLSERVER_NAME}}" -U 'kentico' -P '${{ env.DB_PASSWORD }}' -d "${{ env.DB_DATABASE }}" -Q "SELECT * FROM CMS_User" + dotnet kentico-xperience-dbmanager -- -s "${{ env.SQLSERVER_NAME}}" -d "${{ env.DB_DATABASE }}" -u "${{ env.DB_USER }}" -p "${{ secrets.XPERIENCE_BY_KENTICO_DB_PASSWORD }}" -a "${{ secrets.XPERIENCE_BY_KENTICO_ADMIN_PASSWORD }}" --license-file "${{ env.LICENSE_FILE }}" --use-existing-database --hash-string-salt "" + sqlcmd -S "${{ env.SQLSERVER_NAME}}" -U 'kentico' -P '${{ secrets.XPERIENCE_BY_KENTICO_DB_PASSWORD }}' -d "${{ env.DB_DATABASE }}" -Q "SELECT * FROM CMS_User" - name: Prepare appsettings.json for migration working-directory: ${{ env.UMT_DIR }} @@ -124,15 +112,21 @@ jobs: $appsettings | ConvertTo-Json -Compress | Set-Content $EXAMPLE_APPSETTINGS Get-Content $EXAMPLE_APPSETTINGS + - name: Install dependencies and build + working-directory: ${{ env.UMT_DIR }} + run: | + dotnet restore --locked-mode + dotnet tool restore + dotnet build + - name: Run example migration working-directory: ${{ env.UMT_DIR }}\examples\Kentico.Xperience.UMT.Example.Console\ run: | - dotnet run + dotnet run --no-build - name: Install Playwright working-directory: ${{ env.UMT_DIR }}\tests\Kentico.Xperience.UMT.Tests run: | - dotnet build bin\Debug\net8.0\playwright.ps1 install --with-deps - name: Prepare test.runsettings @@ -144,7 +138,7 @@ jobs: Write-Output "Setting XbK URL for tests: $url" (Get-Content test.runsettings) -replace "([^<]*)", "$url" | Set-Content test.runsettings - (Get-Content test.runsettings) -replace "([^<]*)", "${{ env.XBK_ADMIN_PASSWORD}}" | Set-Content test.runsettings + (Get-Content test.runsettings) -replace "([^<]*)", "${{ secrets.XPERIENCE_BY_KENTICO_ADMIN_PASSWORD }}" | Set-Content test.runsettings Get-Content test.runsettings - name: Start xbk and run tests