Windows Packages #690
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test installation of windows package for latest version | |
name: Windows Packages | |
on: | |
schedule: | |
# run daily 0:00 on main branch | |
- cron: '0 0 * * *' | |
push: | |
tags: | |
- '*' | |
branches: | |
- release_test | |
jobs: | |
build: | |
name: Windows package PG${{ matrix.pg }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
pg: [ 12, 13, 14 ] | |
os: [ windows-2019 ] | |
env: | |
# PostgreSQL configuration | |
PGPORT: 6543 | |
PGDATA: pgdata | |
steps: | |
- name: Checkout TimescaleDB source | |
uses: actions/checkout@v2 | |
- name: Get version | |
id: version | |
run: | | |
# version will only be a proper version in a release branch so we use update_from_version | |
# as fallback for main | |
if (grep '^version = [0-9.]\+$' version.config) | |
{ | |
$version=grep '^version = ' version.config | sed -e 's!^version = !!' | |
} else { | |
$version=grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!' | |
} | |
echo "::set-output name=version::${version}" | |
- name: Install PostgreSQL ${{ matrix.pg }} | |
run: | | |
choco feature disable --name=usePackageExitCodes | |
choco feature disable --name=showDownloadProgress | |
choco install postgresql${{ matrix.pg }} --force -y --install-args="'--prefix $HOME/PostgreSQL/${{ matrix.pg }} --extract-only yes'" | |
choco install wget | |
- name: Install TimescaleDB | |
run: | | |
wget --quiet -O timescaledb.zip 'https://timescalereleases.blob.core.windows.net/windows/timescaledb-postgresql-${{ matrix.pg }}_latest-windows-amd64.zip' | |
tar -xf timescaledb.zip | |
cd timescaledb | |
./setup.exe -yes-tune -pgconfig "$HOME/PostgreSQL/${{ matrix.pg }}/bin/pg_config" | |
- name: Create DB | |
run: | | |
~/PostgreSQL/${{ matrix.pg }}/bin/initdb -U postgres -A trust | |
~/PostgreSQL/${{ matrix.pg }}/bin/pg_ctl start -o "-cshared_preload_libraries=timescaledb" | |
- name: Test creating extension | |
run: | | |
~/PostgreSQL/${{ matrix.pg }}/bin/psql -U postgres -d postgres -X -c "CREATE EXTENSION timescaledb;SELECT extname,extversion,version() FROM pg_extension WHERE extname='timescaledb';" | |
$installed_version = ~/PostgreSQL/${{ matrix.pg }}/bin/psql -U postgres -d postgres -X -t -c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" | |
$installed_version = $installed_version.Trim() | |
if (${installed_version} -notmatch "${{ steps.version.outputs.version }}") | |
{ | |
false | |
} |