Skip to content

Windows Packages

Windows Packages #1120

# 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
- trigger/windows_packages
jobs:
config:
runs-on: ubuntu-latest
outputs:
pg13_earliest: ${{ steps.config.outputs.pg13_abi_min }}
pg14_earliest: ${{ steps.config.outputs.pg14_abi_min }}
pg15_earliest: ${{ steps.config.outputs.pg15_abi_min }}
pg16_earliest: ${{ steps.config.outputs.pg16_abi_min }}
pg13_latest: ${{ steps.config.outputs.pg13_latest }}
pg14_latest: ${{ steps.config.outputs.pg14_latest }}
pg15_latest: ${{ steps.config.outputs.pg15_latest }}
pg16_latest: ${{ steps.config.outputs.pg16_latest }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Read configuration
id: config
run: python .github/gh_config_reader.py
build:
name: Windows package PG${{ matrix.test }}
runs-on: ${{ matrix.os }}
needs: config
strategy:
fail-fast: false
matrix:
os: [ windows-2019 ]
test: [ "13min", "13max", "14min", "14max", "15min", "15max", "16min", "16max" ]
include:
- test: 13min
pg: 13
pkg_version: ${{ fromJson(needs.config.outputs.pg13_earliest) }}.1
- test: 13max
pg: 13
pkg_version: 13.13.0 # hardcoded since 13.14 is not available on chocolatey
- test: 14min
pg: 14
pkg_version: ${{ fromJson(needs.config.outputs.pg14_earliest) }}.1
- test: 14max
pg: 14
pkg_version: 14.10.0 # hardcoded since 14.11 is not available yet
- test: 15min
pg: 15
pkg_version: ${{ fromJson(needs.config.outputs.pg15_earliest) }}.1
- test: 15max
pg: 15
pkg_version: 15.5.0 # hardcoded since 15.6 is not available yet
- test: 16min
pg: 16
pkg_version: ${{ fromJson(needs.config.outputs.pg16_earliest) }}.0
- test: 16max
pg: 16
pkg_version: 16.1.0 # hardcoded since 16.2 is not available yet
env:
# PostgreSQL configuration
PGPORT: 6543
PGDATA: pgdata
steps:
- name: Checkout TimescaleDB source
uses: actions/checkout@v4
- 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=sed -n 's!^version = !!p' version.config
} else {
$version=sed -n 's!^update_from_version = !!p' version.config
}
cat version.config
echo "Determined version: "
echo "version=$version"
echo "version=$version" >>$env:GITHUB_OUTPUT
- name: Install PostgreSQL ${{ matrix.pg }}
run: |
choco feature disable --name=usePackageExitCodes
choco feature disable --name=showDownloadProgress
choco install postgresql${{ matrix.pg }} --version ${{ matrix.pkg_version }} `
--force -y --install-args="'--prefix $HOME/PostgreSQL/${{ matrix.pg }} --extract-only yes'"
choco install wget
- name: Download TimescaleDB
run: "wget --quiet -O timescaledb.zip 'https://github.com/timescale/timescaledb/releases/download/\
${{ steps.version.outputs.version }}/timescaledb-postgresql-${{ matrix.pg}}-windows-amd64.zip'"
- name: Install TimescaleDB
run: |
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" `
-c "SELECT extname,extversion,version() FROM pg_extension WHERE extname='timescaledb'"
$installed_version = ~/PostgreSQL/${{ matrix.pg }}/bin/psql -U postgres `
-d postgres -qtAX -c "SELECT extversion FROM pg_extension WHERE extname='timescaledb'"
$installed_version = $installed_version.Trim()
echo "Installed version is '${installed_version}'"
if ("${installed_version}" -ne "${{ steps.version.outputs.version }}")
{
false
}