Skip to content

Commit

Permalink
Merge pull request #144 from Ujusophy/dev
Browse files Browse the repository at this point in the history
Workflow Update on Postgresql
  • Loading branch information
Ruthiejayjay authored Jul 24, 2024
2 parents 0f15220 + e71f7e1 commit ee0bbec
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 24 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
Expand Down Expand Up @@ -39,11 +54,11 @@ jobs:
cp .env.example .env
echo "APP_KEY=${{ secrets.APP_KEY }}" >> .env
echo "DB_CONNECTION=pgsql" >> .env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
echo "DB_HOST=localhost" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_DATABASE=postgres" >> .env
echo "DB_USERNAME=postgres" >> .env
echo "DB_PASSWORD=postgres" >> .env
# Uncomment the line below if you prefer to set DATABASE_URL instead of individual DB environment variables
# echo "DATABASE_URL=postgres://${{ secrets.DB_USERNAME }}:${{ secrets.DB_PASSWORD }}@${{ secrets.DB_HOST }}:${{ secrets.DB_PORT }}/${{ secrets.DB_DATABASE }}?sslmode=disable" >> .env
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -38,11 +52,11 @@ jobs:
cp .env.example .env
echo "APP_KEY=${{ secrets.APP_KEY }}" >> .env
echo "DB_CONNECTION=pgsql" >> .env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
echo "DB_HOST=localhost" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_DATABASE=postgres" >> .env
echo "DB_USERNAME=postgres" >> .env
echo "DB_PASSWORD=postgres" >> .env
- name: Run database migrations
run: php artisan migrate --force

Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ on:
jobs:
run-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
Expand Down Expand Up @@ -38,11 +53,11 @@ jobs:
cp .env.example .env
echo "APP_KEY=${{ secrets.APP_KEY }}" >> .env
echo "DB_CONNECTION=pgsql" >> .env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
echo "DB_HOST=localhost" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_DATABASE=postgres" >> .env
echo "DB_USERNAME=postgres" >> .env
echo "DB_PASSWORD=postgres" >> .env
- name: Run database migrations
run: php artisan migrate --force

Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ on:
pull_request_target:
branches:
- dev

jobs:
lint:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -44,12 +57,12 @@ jobs:
cp .env.example .env
echo "APP_KEY=${{ secrets.APP_KEY }}" >> .env
echo "DB_CONNECTION=pgsql" >> .env
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env
echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env
echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
echo "DATABASE_URL=postgres://${{ secrets.DB_USERNAME }}:${{ secrets.DB_PASSWORD }}@${{ secrets.DB_HOST }}:${{ secrets.DB_PORT }}/${{ secrets.DB_DATABASE }}?sslmode=disable" >> .env
echo "DB_HOST=localhost" >> .env
echo "DB_PORT=5432" >> .env
echo "DB_DATABASE=postgres" >> .env
echo "DB_USERNAME=postgres" >> .env
echo "DB_PASSWORD=postgres" >> .env
# echo "DATABASE_URL=postgres://${{ secrets.DB_USERNAME }}:${{ secrets.DB_PASSWORD }}@${{ secrets.DB_HOST }}:${{ secrets.DB_PORT }}/${{ secrets.DB_DATABASE }}?sslmode=disable" >> .env
- name: Run database migrations
run: php artisan migrate --force
Expand Down

0 comments on commit ee0bbec

Please sign in to comment.