Skip to content

upgraded postgres to 14 #6

upgraded postgres to 14

upgraded postgres to 14 #6

name: database-goodies
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
id-token: write
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
create_credentials_file: true
export_environment_variables: true
- name: Set up Oracle JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'zulu'
cache: maven
- name: Copy Maven settings
run: |
mkdir -p $HOME/.m2
cp ./travis/maven-settings.xml $HOME/.m2/settings.xml
- name: Update pom.xml version
run: |
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml
- name: Disable SourceClear except for cron jobs
run: |
if [ "${{ github.event_name }}" != "schedule" ]; then
export NOSCAN=1
fi
- name: Install PostgreSQL 14
run: |
sudo apt-get update
sudo apt-get install -y postgresql-14 postgresql-contrib
- name: Set up PostgreSQL 14
run: |
sudo service postgresql start
sudo -u postgres psql -c "create user test with password 'test';"
sudo -u postgres psql -c "create database test owner test;"
- name: Run tests
run: |
mvn -e test
mvn -e -Ppostgresql -Dpostgres.database.url=jdbc:postgresql:test -Dpostgres.database.user=test -Dpostgres.database.password=test verify
- name: Show test reports on failure
if: failure()
run: |
echo "\n=== SUREFIRE REPORTS ===\n"
for F in target/surefire-reports/*.txt; do echo $F; cat $F; echo; done
deploy-snapshots:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
create_credentials_file: true
export_environment_variables: true
- name: Set up Oracle JDK 8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'zulu'
cache: maven
- name: Copy Maven settings
run: |
mkdir -p $HOME/.m2
cp ./travis/maven-settings.xml $HOME/.m2/settings.xml
- name: Update pom.xml version
run: |
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml
- name: Deploy snapshots
run: |
mvn --batch-mode -e -DskipTests=true deploy