From e3a6871c7402889b17e5fe5bac95fa7e7fafcfc9 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Mon, 28 Oct 2024 09:30:30 +0300 Subject: [PATCH 1/5] Build and check workflow for MS Windows --- .../build-and-check-windows-latest.yml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/build-and-check-windows-latest.yml diff --git a/.github/workflows/build-and-check-windows-latest.yml b/.github/workflows/build-and-check-windows-latest.yml new file mode 100644 index 0000000..4189fc2 --- /dev/null +++ b/.github/workflows/build-and-check-windows-latest.yml @@ -0,0 +1,81 @@ +name: Build and Check (windows-latest) + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 0 * * 5' + +jobs: + build_and_test: + + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + pg_version: [10, 11, 12, 13, 14, 15, 16, 17] + use_healpix: [0] + + name: PostgreSQL ${{ matrix.pg_version }} - USE_HEALPIX=${{ matrix.use_healpix }} (windows-latest) + + defaults: + run: + shell: msys2 {0} + + steps: + + - name: Install MSYS2 + uses: msys2/setup-msys2@v2 + with: + update: true + msystem: mingw64 + install: >- + base-devel + curl + git + make + perl + flex + bison + diffutils + mingw-w64-x86_64-zlib + mingw-w64-x86_64-icu + mingw-w64-x86_64-gcc + + - name: Install PostgreSQL + run: | + echo "Workspace: ${GITHUB_WORKSPACE}" + git clone --single-branch -b "REL_${{ matrix.pg_version }}_STABLE" git://git.postgresql.org/git/postgresql.git + cd ${GITHUB_WORKSPACE}/postgresql + ./configure --enable-cassert --without-icu + make -j$(nproc) + make install + + - name: Clone pgSphere + uses: actions/checkout@v4 + with: + ref: 'master' + fetch-depth: 1 + + - name: Build pgSphere + run: | + make --keep-going -j$(nproc) PROFILE='-Werror -Wall' USE_HEALPIX=0 + make USE_HEALPIX=0 install + + - name: Test pgSphere + run: | + initdb -D pgdata -U postgres + pg_ctl -D pgdata -l postgres.log start + make USE_HEALPIX=0 installcheck + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: ${{ env.GITHUB_REF_SLUG_URL }}-pg${{ matrix.pg_version }}-use-healpix-${{ matrix.use_healpix }}-${{ github.run_id }} + if-no-files-found: ignore + path: | + ./**/*.log + ./**/*.diffs From e4a9daf4a152472bad3e1ef322a51c2294814107 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Tue, 5 Nov 2024 13:48:10 +0300 Subject: [PATCH 2/5] Fix found issues after review --- .github/workflows/build-and-check-windows-latest.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-check-windows-latest.yml b/.github/workflows/build-and-check-windows-latest.yml index 4189fc2..b4c8158 100644 --- a/.github/workflows/build-and-check-windows-latest.yml +++ b/.github/workflows/build-and-check-windows-latest.yml @@ -70,6 +70,10 @@ jobs: pg_ctl -D pgdata -l postgres.log start make USE_HEALPIX=0 installcheck + - name: Show installcheck regression.diffs + if: ${{ failure() }} + run: cat regression.diffs + - name: Upload artifacts uses: actions/upload-artifact@v4 if: success() || failure() From 4922a2efe8d6e9ea5d08483265f3cc2256566fc0 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Thu, 7 Nov 2024 12:47:14 +0300 Subject: [PATCH 3/5] Add crushtest in build-and-check-windows-latest workflow --- .../workflows/build-and-check-windows-latest.yml | 14 +++++++++++++- expected/init_extended.out | 6 +++--- sql/init_extended.sql | 6 +++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-check-windows-latest.yml b/.github/workflows/build-and-check-windows-latest.yml index b4c8158..1bbb43e 100644 --- a/.github/workflows/build-and-check-windows-latest.yml +++ b/.github/workflows/build-and-check-windows-latest.yml @@ -64,16 +64,28 @@ jobs: make --keep-going -j$(nproc) PROFILE='-Werror -Wall' USE_HEALPIX=0 make USE_HEALPIX=0 install - - name: Test pgSphere + - name: Test pgSphere (installcheck) run: | initdb -D pgdata -U postgres pg_ctl -D pgdata -l postgres.log start make USE_HEALPIX=0 installcheck + pg_ctl -D pgdata -l postgres_installcheck.log stop + rm -rf pgdata - name: Show installcheck regression.diffs if: ${{ failure() }} run: cat regression.diffs + - name: Test pgSphere (crushtest) + run: | + initdb -D pgdata -U postgres + pg_ctl -D pgdata -l postgres_crushtest.log start + make USE_HEALPIX=0 crushtest + + - name: Show crushtest regression.diffs + if: ${{ failure() }} + run: cat regression.diffs + - name: Upload artifacts uses: actions/upload-artifact@v4 if: success() || failure() diff --git a/expected/init_extended.out b/expected/init_extended.out index 382a0dc..adeaa8d 100644 --- a/expected/init_extended.out +++ b/expected/init_extended.out @@ -1,18 +1,18 @@ -- indexed operations..... -- spoint_data and scircle_data tables have to be created and indexed using -\! testsuite/gen_point.pl 1 > results/gen_point_1.sql +\! perl testsuite/gen_point.pl 1 > results/gen_point_1.sql \i results/gen_point_1.sql CREATE TABLE spoint_data (sp spoint); COPY spoint_data (sp) FROM stdin; CREATE INDEX sp_idx ON spoint_data USING gist (sp); -- and -\! testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql +\! perl testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql \i results/gen_circle_1_0.1.sql CREATE TABLE scircle_data (sc scircle); COPY scircle_data (sc) FROM stdin; CREATE INDEX sc_idx ON scircle_data USING gist (sc); -- -\! testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql +\! perl testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql \i results/gen_poly_1_0.1_4.sql CREATE TABLE spoly_data (sp spoly); COPY spoly_data (sp) FROM stdin; diff --git a/sql/init_extended.sql b/sql/init_extended.sql index 800d7e4..b28f0ef 100644 --- a/sql/init_extended.sql +++ b/sql/init_extended.sql @@ -2,15 +2,15 @@ -- spoint_data and scircle_data tables have to be created and indexed using -\! testsuite/gen_point.pl 1 > results/gen_point_1.sql +\! perl testsuite/gen_point.pl 1 > results/gen_point_1.sql \i results/gen_point_1.sql -- and -\! testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql +\! perl testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql \i results/gen_circle_1_0.1.sql -- -\! testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql +\! perl testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql \i results/gen_poly_1_0.1_4.sql From b34d82a39212a4fbb638dd07f0f0d93f5266eca2 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Thu, 7 Nov 2024 13:13:18 +0300 Subject: [PATCH 4/5] Fix pgsphere cloned branch --- .github/workflows/build-and-check-windows-latest.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-and-check-windows-latest.yml b/.github/workflows/build-and-check-windows-latest.yml index 1bbb43e..658da28 100644 --- a/.github/workflows/build-and-check-windows-latest.yml +++ b/.github/workflows/build-and-check-windows-latest.yml @@ -55,9 +55,6 @@ jobs: - name: Clone pgSphere uses: actions/checkout@v4 - with: - ref: 'master' - fetch-depth: 1 - name: Build pgSphere run: | From a57c9b68c3710af462371ecc274ad1590e69ea01 Mon Sep 17 00:00:00 2001 From: Vitaly Davydov Date: Thu, 7 Nov 2024 14:57:11 +0300 Subject: [PATCH 5/5] Change log file name --- .github/workflows/build-and-check-windows-latest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-check-windows-latest.yml b/.github/workflows/build-and-check-windows-latest.yml index 658da28..e2d7b27 100644 --- a/.github/workflows/build-and-check-windows-latest.yml +++ b/.github/workflows/build-and-check-windows-latest.yml @@ -64,9 +64,9 @@ jobs: - name: Test pgSphere (installcheck) run: | initdb -D pgdata -U postgres - pg_ctl -D pgdata -l postgres.log start + pg_ctl -D pgdata -l postgres_installcheck.log start make USE_HEALPIX=0 installcheck - pg_ctl -D pgdata -l postgres_installcheck.log stop + pg_ctl -D pgdata stop rm -rf pgdata - name: Show installcheck regression.diffs @@ -78,6 +78,7 @@ jobs: initdb -D pgdata -U postgres pg_ctl -D pgdata -l postgres_crushtest.log start make USE_HEALPIX=0 crushtest + pg_ctl -D pgdata stop - name: Show crushtest regression.diffs if: ${{ failure() }}