Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Mar 25, 2024
1 parent 53cd9bb commit 8f2d56c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=larachain
DB_USERNAME=postgres
DB_PASSWORD=

SESSION_DRIVER=database
SESSION_LIFETIME=120
Expand Down
10 changes: 5 additions & 5 deletions .env.github
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=3307
DB_DATABASE=portal
DB_USERNAME=root
DB_PASSWORD=
DB_PORT=5432
DB_DATABASE=testing
DB_USERNAME=postgres
DB_PASSWORD=password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
env:
DB_CONNECTION: pgsql
DB_DATABASE: test
DB_DATABASE: testing
DB_USERNAME: postgres
DB_PASSWORD: password
APP_ENV: testing
Expand All @@ -17,7 +17,7 @@ jobs:
image: postgres:latest
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: test
POSTGRES_DB: testing
ports:
- 5432/tcp
options: --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=5
Expand All @@ -29,6 +29,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Create the PostgreSQL database
run: |
sudo service postgresql start
PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U $POSTGRES_USER -tc "SELECT 1 FROM pg_database WHERE datname = 'testing'" | grep -q 1 || PGPASSWORD=$POSTGRES_PASSWORD psql -h localhost -U $POSTGRES_USER -c "CREATE DATABASE testing"
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
Expand All @@ -40,7 +48,7 @@ jobs:
- name: Enable PostgreSQL Extensions
run: |
sudo service postgresql start
sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS vector;" -d test
sudo -u postgres psql -c "CREATE EXTENSION IF NOT EXISTS vector;" -d testing
- name: Test with phpunit
run: |
Expand Down

0 comments on commit 8f2d56c

Please sign in to comment.