Skip to content

Commit

Permalink
ci: Changed dependencies in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Feb 27, 2024
1 parent f834f91 commit 3096ef3
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ on:
branches: [ "main" ]

jobs:
database-creation:
needs: [ build ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Docker and Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start PostgreSQL with Docker Compose
run: docker-compose up -d
- name: Perform Database Operation
run: |
echo "Waiting for PostgreSQL to be ready..."
until docker exec $(docker-compose ps -q postgres) pg_isready; do
sleep 1;
done
echo "PostgreSQL is ready."
- name: Shutdown PostgreSQL
run: docker-compose down
build:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -38,25 +59,3 @@ jobs:
distribution: 'temurin'
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

database-operation:
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Docker and Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Start PostgreSQL with Docker Compose
run: docker-compose up -d
- name: Perform Database Operation
run: |
echo "Waiting for PostgreSQL to be ready..."
until docker exec $(docker-compose ps -q postgres) pg_isready; do
sleep 1;
done
echo "PostgreSQL is ready."
- name: Shutdown PostgreSQL
run: docker-compose down

0 comments on commit 3096ef3

Please sign in to comment.