Windows Packages #894
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: | |
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 }} | |
pg13_latest: ${{ steps.config.outputs.pg13_latest }} | |
pg14_latest: ${{ steps.config.outputs.pg14_latest }} | |
pg15_latest: ${{ steps.config.outputs.pg15_latest }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- 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" ] | |
include: | |
- test: 13min | |
pg: 13 | |
pkg_version: ${{ fromJson(needs.config.outputs.pg13_earliest) }}.1 | |
- test: 13max | |
pg: 13 | |
pkg_version: ${{ fromJson(needs.config.outputs.pg13_latest) }} | |
- test: 14min | |
pg: 14 | |
pkg_version: ${{ fromJson(needs.config.outputs.pg14_earliest) }}.1 | |
- test: 14max | |
pg: 14 | |
pkg_version: 14.5.1 # hardcoded due to issues with PG14.7 on chocolatey | |
- test: 15min | |
pg: 15 | |
pkg_version: ${{ fromJson(needs.config.outputs.pg15_earliest) }}.1 | |
- test: 15max | |
pg: 15 | |
pkg_version: 15.0.1 # hardcoded due to issues with PG15.2 on chocolatey | |
env: | |
# PostgreSQL configuration | |
PGPORT: 6543 | |
PGDATA: pgdata | |
steps: | |
- name: Checkout TimescaleDB source | |
uses: actions/checkout@v3 | |
- 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 | |
} |