Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 committed Jan 15, 2025
1 parent c73d268 commit 5740b18
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 23 deletions.
25 changes: 25 additions & 0 deletions .github/composite-actions/build-modified-postgres/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ runs:
$GITHUB_WORKSPACE/.github/scripts/clone_engine_repo "$REPOSITORY_OWNER" "$ENGINE_BRANCH"
cd postgresql_modified_for_babelfish
git rev-parse HEAD
rm -rf ~/.ccache
if [[ ${{inputs.tap_tests}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse HEAD)-tap" >> $GITHUB_ENV
elif [[ ${{inputs.code_coverage}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse HEAD)-coverage" >> $GITHUB_ENV
elif [[ ${{inputs.release_mode}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse HEAD)-release" >> $GITHUB_ENV
else
echo "CCACHE_KEY=$(git rev-parse HEAD)-default" >> $GITHUB_ENV
fi
shell: bash

- uses: actions/cache/restore@v4
if: ${{ github.event_name == 'pull_request' }}
with:
path: ~/.ccache
key: ${{ env.CCACHE_KEY }}

- name: Save cache if cache hit fails in pull requests
if: ${{ github.event_name == 'pull_request' }} && steps.cache.outputs.cache-hit != 'true'
run: echo "SAVE_CCACHE=1" >> $GITHUB_ENV

- name: Checkout, Build, and Install the Modified PostgreSQL Instance and Run Tests
run: |
cd postgresql_modified_for_babelfish
if [[ ${{inputs.tap_tests}} == "yes" ]]; then
./configure CC='ccache gcc' --prefix=$HOME/${{ inputs.install_dir }}/ --with-python PYTHON=/usr/bin/python3.8 --enable-cassert CFLAGS="-ggdb" --with-libxml --with-uuid=ossp --with-icu --enable-tap-tests --with-gssapi
elif [[ ${{inputs.code_coverage}} == "yes" ]]; then
Expand Down
9 changes: 0 additions & 9 deletions .github/composite-actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,3 @@ runs:
source ~/.bashrc && echo $PATH
echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
shell: bash

- name: Restore ccache
id: cache-compiler
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ env.NOW }}
restore-keys: |
ccache-${{ runner.os }}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ runs:
install_dir: ${{ inputs.install_dir }}
extension_branch: ${{ inputs.extension_branch }}

- name: Save cache
if: always() && steps.build-extensions-newer == 'success'
uses: ./.github/composite-actions/save-cache-on-push/action.yml

# Not created and used composite action update-extensions here since, in the previous step it has
# checked out a branch/tag which may not have the updated update-extension composite action
- name: Update extensions
Expand Down Expand Up @@ -94,11 +98,11 @@ runs:
tar_dir="latest"
fi
export inputFilesPath=upgrade/$tar_dir/verification_cleanup/$base_dir
mvn -B -ntp test
export inputFilesPath=input
for filename in $(grep -v "^ignore.*\|^#.*\|^cmd.*\|^all.*\|^$" upgrade/$base_dir/schedule); do
sed -i "s/\b$filename[ ]*\b$/$filename-vu-verify\\n$filename-vu-cleanup/g" upgrade/$base_dir/schedule
done
export scheduleFile=upgrade/$base_dir/schedule
mvn -B -ntp test
shell: bash
4 changes: 2 additions & 2 deletions .github/composite-actions/run-jdbc-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ runs:
cd test/JDBC/
if [[ '${{ inputs.migration_mode }}' == 'single-db' ]];then
export isSingleDbMode=true
mvn -B -ntp test
unset isSingleDbMode
else
mvn -B -ntp test
fi
shell: bash
4 changes: 2 additions & 2 deletions .github/composite-actions/run-verify-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ runs:
export inputFilesPath=upgrade/singledb/verification_cleanup
fi
mvn -B -ntp test
export inputFilesPath=input
# Skip test BABEL-404 for previous versions while testing dump/restore since it specifies
Expand All @@ -74,7 +74,7 @@ runs:
sed -i "s/\b$filename[ ]*\b$/$filename-vu-verify\\n$filename-vu-cleanup/g" upgrade/$base_dir/schedule
done
export scheduleFile=upgrade/$base_dir/schedule
mvn -B -ntp test
shell: bash

- name: Cleanup babelfish database
Expand Down
21 changes: 21 additions & 0 deletions .github/composite-actions/save-cache-on-push/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Save Ccache if push event'

inputs:

runs:
using: "composite"
steps:

- uses: actions/cache/save@v4
if: ${{ env.CCACHE_KEY != '' && (github.event_name != 'pull_request' || SAVE_CCACHE == 1)}}
with:
path: ~/.ccache
key: ${{ env.CCACHE_KEY }}

- name: Clean ccache directory and unset env variables
shell: bash
run: |
rm -rf ~/.ccache
echo "CCACHE_KEY=" >> $GITHUB_ENV
echo "SAVE_CCACHE=" >> $GITHUB_ENV
8 changes: 6 additions & 2 deletions .github/composite-actions/setup-base-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ runs:
fi
export inputFilesPath=upgrade/$base_dir/preparation
mvn -B -ntp test
# Skip test BABEL-404 for previous versions while testing dump/restore since it specifies
# contraint column ordering which is expected to fail after fix for BABEL-4888
Expand All @@ -216,7 +216,7 @@ runs:
sed -i "s/\b$filename[ ]*\b$/$filename-vu-prepare/g" upgrade/$base_dir/schedule
done
export scheduleFile=upgrade/$base_dir/schedule
mvn -B -ntp test
shell: bash

- uses: actions/checkout@v2
Expand Down Expand Up @@ -265,3 +265,7 @@ runs:
mkdir -p ~/upgrade
cp test/python/output/upgrade_validation/* ~/upgrade
shell: bash

- name: Save cache
if: always() && steps.run-dependency-check.outcome == 'success'
uses: ./.github/composite-actions/save-cache-on-push/action.yml
4 changes: 4 additions & 0 deletions .github/composite-actions/setup-new-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ runs:
with:
install_dir: ${{ inputs.pg_new_dir }}

- name: Save cache
if: always() && steps.build-postgis-extension == 'success'
uses: ./.github/composite-actions/save-cache-on-push/action.yml

- name: Setup new data directory
id: setup-new-datadir
if: always() && steps.build-postgis-extension.outcome == 'success'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jdbc-tests-db-collation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
sudo ~/${{env.INSTALL_DIR}}/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "select default_collation from sys.babelfish_sysdatabases where name = 'master';"
cd test/JDBC/
export isdbCollationMode=true
mvn -B -ntp test
unset isdbCollationMode
- name: Start secondary server
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
cd test/JDBC/
export isdbCollationMode=true
export inputFilesPath=replication
mvn -B -ntp test
unset isdbCollationMode
- name: Cleanup babelfish database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
cd test/JDBC/
# set env variable serverCollationName to current server collation name
export serverCollationName=${{ env.SERVER_COLLATION_NAME }}
mvn -B -ntp test
# reset env variable
unset serverCollationName
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jdbc-tests-with-parallel-query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
cd test/JDBC/
# set env variable isParallelQueryMode to true to let jdbc know not to run tests of file parallel_query_jdbc_schedule
export isParallelQueryMode=true
mvn -B -ntp test
# reset env variable
unset isParallelQueryMode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/major-version-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ jobs:
cd test/JDBC/
# temporarily ignore test BABEL-2086
echo 'ignore#!#BABEL-2086' >> jdbc_schedule
mvn -B -ntp test
- name: Upload Postgres log
if: always() && steps.jdbc.outcome == 'failure'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minor-version-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
export PATH=~/${{env.INSTALL_DIR}}/bin:$PATH
export PG_SRC=~/work/babelfish_extensions/postgresql_modified_for_babelfish
cd test/JDBC/
mvn -B -ntp test
- name: Upload Log
if: always()
Expand Down

0 comments on commit 5740b18

Please sign in to comment.