Skip to content

auth issue

auth issue #10

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: 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: 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
cleanup_credentials: true
- name: Install PostgreSQL 14
run: |
sudo apt-get update
sudo apt-get install -y postgresql-14 postgresql-contrib
- name: Configure PostgreSQL for md5 authentication
run: |
sudo sed -i "s/peer/md5/" /etc/postgresql/14/main/pg_hba.conf
sudo sed -i "s/scram-sha-256/md5/" /etc/postgresql/14/main/pg_hba.conf
sudo service postgresql restart
- name: Set up PostgreSQL
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
cleanup_credentials: 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