Skip to content

Commit

Permalink
Test custom chocolatey packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Oct 8, 2023
1 parent 7daed5a commit df5273c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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'
# For some reason, the parenthesis around the second OR argument is mandatory for the expression to work correctly, even though
# the operator precedence should have been enough.
$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 }}'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit df5273c

Please sign in to comment.