Skip to content

Commit

Permalink
Use PostgreSQL on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Sep 14, 2023
1 parent 5d56e51 commit 1609498
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,14 @@ jobs:
- name: composer install
run: composer install --no-interaction -o

- name: Setup to database
- name: Start PostgreSQL on Windows
# see https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/
run: |
choco install -y mysql
mysql --user=root -e "CREATE DATABASE eccube_db DEFAULT COLLATE=utf8_general_ci;"
mysql --user=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;"
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
$env:PGPASSWORD = 'root'
& $env:PGBIN\createdb --owner=postgres eccube_db
- name: Setup PHP
uses: nanasess/setup-php@master
Expand All @@ -190,16 +193,19 @@ jobs:

- name: Setup to EC-CUBE
env:
DB: mysql
USER: root
DBUSER: root
DBPASS: password
DB: pgsql
DBUSER: postgres
DBPASS: root
DBNAME: eccube_db
DBPORT: 3306
DBPORT: 5432
DBSERVER: 127.0.0.1
HTTP_URL: http://127.0.0.1:8085/
HTTPS_URL: http://127.0.0.1:8085/
run: bash eccube_install.sh mysql
run: |
echo $PGBIN
ls -al $PGBIN
export PATH="$PGBIN:$PATH"
bash eccube_install.sh pgsql
shell: bash
- run: sleep 1
shell: bash
Expand Down

0 comments on commit 1609498

Please sign in to comment.