ci: Run server tests on pg branch (#34372)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated workflow conditions to ensure PostgreSQL build is triggered
when the pull request head reference is 'pg'.
- Simplified logic to unconditionally start the PostgreSQL container in
the build process.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Shrikant Sharat Kandula 2024-06-21 12:52:18 +05:30 committed by GitHub
parent ae161b14c8
commit 6ef4d2a6af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -45,7 +45,7 @@ jobs:
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
is-pg-build: ${{ github.event.pull_request.base.ref == 'pg' }}
is-pg-build: ${{ github.event.pull_request.base.ref == 'pg' || github.event.pull_request.head.ref == 'pg' }}
client-build:
name: client-build

View File

@ -139,11 +139,10 @@ jobs:
java-version: "17"
- name: Conditionally start PostgreSQL
if: |
inputs.is-pg-build == 'true' && inputs.skip-tests != 'true'
run: |
if [[ ${{ inputs.is-pg-build }} == 'true' ]]; then
echo "Requesting PostgreSQL container to be started for pg specific build."
docker run --name appsmith-pg -p 5432:5432 -d -e POSTGRES_PASSWORD=password postgres:alpine postgres -N 1500
fi
docker run --name appsmith-pg -p 5432:5432 -d -e POSTGRES_PASSWORD=password postgres:alpine postgres -N 1500
# Retrieve maven dependencies from cache. After a successful run, these dependencies are cached again
- name: Cache maven dependencies