Rearrange the SQL statements update script #16602
Workflow file for this run
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
name: Minor Version Upgrade Tests for empty database | |
on: [push, pull_request] | |
jobs: | |
extension-tests: | |
env: | |
ENGINE_VER_FROM: BABEL_2_1_STABLE__PG_14_3 | |
EXTENSION_VER_FROM: BABEL_2_1_STABLE | |
name: Build and test | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Dependencies | |
id: install-dependencies | |
if: always() | |
uses: ./.github/composite-actions/install-dependencies | |
- name: Clone, build, and run tests for Postgres engine using ${{env.ENGINE_VER_FROM}} | |
id: build-modified-postgres-older | |
if: always() && steps.install-dependencies.outcome == 'success' | |
uses: ./.github/composite-actions/build-modified-postgres | |
with: | |
engine_branch: ${{env.ENGINE_VER_FROM}} | |
- name: Compile ANTLR | |
id: compile-antlr | |
if: always() && steps.build-modified-postgres-older.outcome == 'success' | |
uses: ./.github/composite-actions/compile-antlr | |
- uses: actions/checkout@v2 | |
with: | |
repository: babelfish-for-postgresql/babelfish_extensions | |
ref: ${{env.EXTENSION_VER_FROM}} | |
- name: Set env variables and build extensions using ${{env.EXTENSION_VER_FROM}} | |
id: build-extensions-older | |
if: always() && steps.compile-antlr.outcome == 'success' | |
uses: ./.github/composite-actions/build-extensions | |
- name: Install extensions | |
id: install-extensions-older | |
if: always() && steps.build-extensions-older.outcome == 'success' | |
uses: ./.github/composite-actions/install-extensions | |
- uses: actions/checkout@v2 | |
- name: Build and run tests for Postgres engine using latest engine | |
id: build-modified-postgres-newer | |
if: always() && steps.install-extensions-older.outcome == 'success' | |
uses: ./.github/composite-actions/build-modified-postgres | |
- name: Set env variables and build extensions | |
id: build-extensions-newer | |
uses: ./.github/composite-actions/build-extensions | |
- name: Update extensions | |
if: always() && steps.build-extensions-newer.outcome == 'success' | |
run: | | |
cd ~ | |
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile restart | |
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "\dx" | |
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "ALTER EXTENSION "babelfishpg_common" UPDATE; ALTER EXTENSION "babelfishpg_tsql" UPDATE;" | |
sudo ~/postgres/bin/psql -d jdbc_testdb -U runner -c "\dx" | |
sqlcmd -S localhost -U jdbc_user -P 12345678 -Q "SELECT @@version GO" | |
- name: Run JDBC Tests | |
id: jdbc | |
timeout-minutes: 60 | |
run: | | |
cd test/JDBC/ | |
mvn test | |
- name: Upload Log | |
if: always() && steps.jdbc.outcome == 'failure' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: postgres-log | |
path: ~/postgres/data/logfile | |
# The test summary files contain paths with ':' characters, which is not allowed with the upload-artifact actions | |
- name: Rename Test Summary Files | |
id: test-file-rename | |
if: always() && steps.jdbc.outcome == 'failure' | |
run: | | |
cd test/JDBC/Info | |
timestamp=`ls -Art | tail -n 1` | |
cd $timestamp | |
mv $timestamp.diff ../upgrade-output-diff.diff | |
mv "$timestamp"_runSummary.log ../upgrade-run-summary.log | |
- name: Upload Run Summary | |
if: always() && steps.test-file-rename == 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: upgrade-run-summary.log | |
path: test/JDBC/Info/upgrade-run-summary.log | |
- name: Upload Output Diff | |
if: always() && steps.jdbc.outcome == 'failure' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: upgrade-output-diff.diff | |
path: test/JDBC/Info/upgrade-output-diff.diff |