Skip to content

Commit

Permalink
Adding tapTest and coverage key saves
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthBITS committed Jan 16, 2025
1 parent 06d0f9f commit 3d4d66f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/composite-actions/build-modified-postgres/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,26 @@ runs:
cd postgresql_modified_for_babelfish
rm -rf ~/.ccache
if [[ ${{inputs.tap_tests}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse --short HEAD)-tapTest" >> $GITHUB_ENV
echo "CRESTORE_KEY=$(git rev-parse --short HEAD)-tapTest" >> $GITHUB_ENV
elif [[ ${{inputs.code_coverage}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse --short HEAD)-coverage" >> $GITHUB_ENV
echo "CRESTORE_KEY=$(git rev-parse --short HEAD)-coverage" >> $GITHUB_ENV
elif [[ ${{inputs.release_mode}} == "yes" ]]; then
echo "CCACHE_KEY=$(git rev-parse --short HEAD)-release" >> $GITHUB_ENV
echo "CRESTORE_KEY=$(git rev-parse --short HEAD)-release" >> $GITHUB_ENV
else
echo "CCACHE_KEY=$(git rev-parse --short HEAD)-default" >> $GITHUB_ENV
echo "CRESTORE_KEY=$(git rev-parse --short HEAD)-default" >> $GITHUB_ENV
fi
shell: bash

- uses: actions/cache/restore@v4
id: restore-ccache
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' }} || ${{ inputs.code_coverage == 'yes' }}
with:
path:
~/.ccache
key:
random-random
restore-keys:
${{ env.CCACHE_KEY }}
${{ env.CRESTORE_KEY }}

- name: Save cache if cache hit fails in pull requests
if: ${{ github.event_name == 'pull_request' }}
Expand Down
6 changes: 3 additions & 3 deletions .github/composite-actions/save-ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: 'Save Ccache on push'

runs:
using: "composite"
steps:
steps:

- name: Setup new cache key
if: always()
run: |
echo "CCACHE_KEY=${{env.CCACHE_KEY}}-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "CCACHE_KEY=${{env.CRESTORE_KEY}}-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
shell: bash

- uses: actions/cache/save@v4
if: always() && ${{ env.CCACHE_KEY != '' && (github.event_name != 'pull_request' || env.SAVE_CCACHE == 1)}}
if: always() && ${{ env.CRESTORE_KEY != '' && (github.event_name != 'pull_request' || env.SAVE_CCACHE == 1)}}
with:
path:
~/.ccache
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dotnet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
id: install-extensions
if: always() && steps.build-postgis-extension.outcome == 'success'
uses: ./.github/composite-actions/install-extensions

- name: Save cache
if: always() && steps.install-extensions.outcome == 'success'
uses: ./.github/composite-actions/save-ccache

- name: Run Dotnet Tests
id: run-dotnet-tests
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/tap-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
with:
engine_branch: ${{env.ENGINE_BRANCH_16}}
install_dir: ${{env.INSTALL_DIR_16}}



- name: Build Modified Postgres using ${{env.ENGINE_BRANCH_OLD}}
id: build-modified-postgres-old
if: always() && steps.build-modified-postgres-16.outcome == 'success'
Expand Down Expand Up @@ -100,23 +101,31 @@ jobs:
sudo make USE_PGXS=1 PG_CONFIG=~/psql_source/bin/pg_config install
shell: bash



- name: Build Extensions using ${{env.EXTENSION_BRANCH_OLD}}
id: build-extensions-old
if: always() && steps.build-postgis-extension-old.outcome == 'success'
uses: ./.github/composite-actions/build-extensions
with:
install_dir: ${{env.OLD_INSTALL_DIR}}
extension_branch: ${{env.EXTENSION_BRANCH_OLD}}

- name: Save cache
if: always() && steps.build-extensions-old.outcome == 'success'
uses: ./.github/composite-actions/save-ccache

- uses: actions/checkout@v2

- name: Build Modified Postgres using latest version
id: build-modified-postgres-new
if: always() && steps.build-extensions-old.outcome == 'success'
uses: ./.github/composite-actions/build-modified-postgres
with:
tap_tests: 'yes'
install_dir: ${{env.NEW_INSTALL_DIR}}



- name: Compile new ANTLR
id: compile-new-antlr
Expand All @@ -139,6 +148,10 @@ jobs:
with:
install_dir: ${{env.NEW_INSTALL_DIR}}

- name: Save cache
if: always() && steps.build-extensions-old.outcome == 'success'
uses: ./.github/composite-actions/save-ccache

- name: Run TAP Tests
id: tap
if: always() && steps.build-postgis-extension.outcome == 'success'
Expand Down

0 comments on commit 3d4d66f

Please sign in to comment.