From a22bdb664a8e3e33cd20eb7b2d8f4c59ba4088b6 Mon Sep 17 00:00:00 2001 From: Laurents Meyer Date: Sun, 8 Oct 2023 03:13:00 +0200 Subject: [PATCH] Test custom chocolatey packages. --- .github/workflows/build.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a25afeb87..4d100cceb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ env: maxConnections: 512 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 - skipAllTests: false + skipAllTests: true skipWindowsTests: false jobs: BuildAndTest: @@ -41,7 +41,9 @@ jobs: - ubuntu-latest include: - os: windows-latest - dbVersion: 8.0.31-mysql + dbVersion: 8.0.34-mysql + - os: windows-latest + dbVersion: 5.7.43-mysql runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -59,7 +61,9 @@ jobs: $databaseServerVersion = $dbVersionParts[0] echo "databaseServerVersion=$databaseServerVersion" >> $env:GITHUB_ENV - $skipTests = '${{ env.skipAllTests }}' -eq 'true' -or $os -eq 'windows' -and '${{ env.skipWindowsTests }}' -eq 'true' + # The parenthesis around the second OR argument is mandatory for the expression to work correctly, because in PowerShell, AND and OR + # operators have the SAME precedence. + $skipTests = '${{ env.skipAllTests }}' -eq 'true' -or ($os -eq 'windows' -and '${{ env.skipWindowsTests }}' -eq 'true') echo "skipTests=$skipTests" >> $env:GITHUB_ENV $sqlMode = $databaseServerType -eq 'mariadb' ? '${{ env.mariadbSqlMode }}' : $databaseServerType -eq 'mysql' -and $databaseServerVersion.Split('.')[0] -lt 8 ? '${{ env.mysqlLegacySqlMode }}' : '${{ env.mysqlCurrentSqlMode }}' @@ -113,8 +117,8 @@ jobs: uses: actions/cache@v3 if: ${{ env.os == 'windows' }} with: - path: ${{ env.windowsUserTempLocation }}\${{ env.databaseServerType }} - key: database-windows-${{ env.databaseServerType }}-${{ env.databaseServerVersion }}-v2 + path: ${{ env.windowsUserTempLocation }}\Pomelo.Chocolatey.${{ env.databaseServerType }}.Server + key: database-windows-${{ env.databaseServerType }}-${{ env.databaseServerVersion }}-v3 - name: Install Database Server - Linux if: ${{ env.os == 'linux' }} shell: pwsh @@ -163,8 +167,8 @@ jobs: run: | $mySqlServiceName = '${{ env.databaseServerType }}_${{ env.databaseServerVersion }}' $lowerCaseTableNames = 2 - $mySqlBinPath = 'C:\tools\mysql\current\bin' - $mySqlIniPath = 'C:\tools\mysql\current\my.ini' + $mySqlBinPath = 'C:\tools\Pomelo.Chocolatey.${{ env.databaseServerType }}.Server\current\bin' + $mySqlIniPath = 'C:\tools\Pomelo.Chocolatey.${{ env.databaseServerType }}.Server\current\my.ini' $mySqlDataPath = 'C:\ProgramData\MySQL\data' dir "$env:Temp\${{ env.databaseServerType }}\${{ env.databaseServerVersion }}" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName @@ -177,8 +181,7 @@ jobs: } # choco config set cacheLocation '$(Pipeline.Workspace)/cache/database' - echo "Chocolatey command: choco install '${{ env.databaseServerType }}' '--version=${{ env.databaseServerVersion }}' --params `"/serviceName:$mySqlServiceName`"" - choco install '${{ env.databaseServerType }}' '--version=${{ env.databaseServerVersion }}' --params "/serviceName:$mySqlServiceName" + choco install 'Pomelo.Chocolatey.${{ env.databaseServerType }}.Server' '--version=${{ env.databaseServerVersion }}' --source 'https://www.myget.org/F/pomelo/api/v2;https://community.chocolatey.org/api/v2' --params "/serviceName:$mySqlServiceName" Get-Service '*${{ env.databaseServerType }}*' -ErrorAction SilentlyContinue Stop-Service $mySqlServiceName -Verbose