Skip to content

Windows Packages

Windows Packages #1211

# Test installation of windows package for latest version
name: Windows Packages
"on":
schedule:
# run daily 0:00 on main branch
- cron: '0 0 * * *'
pull_request:
paths: .github/workflows/windows-packages.yaml
push:
tags:
- '*'
branches:
- release_test
- trigger/windows_packages
jobs:
config:
runs-on: ubuntu-latest
outputs:
pg14_earliest: ${{ steps.config.outputs.pg14_abi_min }}
pg15_earliest: ${{ steps.config.outputs.pg15_abi_min }}
pg16_earliest: ${{ steps.config.outputs.pg16_abi_min }}
pg17_earliest: ${{ steps.config.outputs.pg17_abi_min }}
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: [ "14min", "14max", "15min", "15max", "16min", "16max", "17min" ]
include:
- 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
- test: 17min
pg: 17
pkg_version: ${{ fromJson(needs.config.outputs.pg17_earliest) }}.0
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
}