-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
178 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: '3' | ||
|
||
services: | ||
mysql: | ||
image: 'mysql/mysql-server:latest' | ||
ports: | ||
- 9910:3306 | ||
environment: | ||
- MYSQL_DATABASE=goravel | ||
- MYSQL_USER=goravel | ||
- MYSQL_PASSWORD=GoravelTest123 | ||
- MYSQL_RANDOM_ROOT_PASSWORD="yes" | ||
postgres: | ||
image: 'postgres:latest' | ||
ports: | ||
- 9920:5432 | ||
environment: | ||
- TZ=Asia/Shanghai | ||
- POSTGRES_DB=goravel | ||
- POSTGRES_USER=goravel | ||
- POSTGRES_PASSWORD=GoravelTest123 | ||
mssql: | ||
image: '${MSSQL_IMAGE:-mcmoe/mssqldocker}:latest' | ||
ports: | ||
- 9930:1433 | ||
environment: | ||
- ACCEPT_EULA=Y | ||
- SA_PASSWORD=GoravelTest123 | ||
- MSSQL_DB=goravel | ||
- MSSQL_USER=goravel | ||
- MSSQL_PASSWORD=GoravelTest123 | ||
redis: | ||
image: 'redis:latest' | ||
ports: | ||
- 9940:6379 | ||
environment: | ||
- REDIS_PASSWORD=GoravelTest123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
echo "OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
|
||
jobs: | ||
# Label of the container job | ||
sqlite: | ||
strategy: | ||
matrix: | ||
go: | ||
- "stable" | ||
- "oldstable" | ||
platform: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Run tests | ||
run: GORAVEL_DATABASE=sqlite bash .github/docker.sh | ||
|
||
mysql: | ||
strategy: | ||
matrix: | ||
dbversion: [ 'mysql:latest' ] | ||
go: | ||
- "stable" | ||
- "oldstable" | ||
platform: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.platform }} | ||
|
||
services: | ||
mysql: | ||
image: ${{ matrix.dbversion }} | ||
env: | ||
MYSQL_DATABASE: goravel | ||
MYSQL_USER: goravel | ||
MYSQL_PASSWORD: GoravelTest123 | ||
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | ||
ports: | ||
- 9910:3306 | ||
options: >- | ||
--health-cmd "mysqladmin ping -u${MYSQL_USER} -p${MYSQL_PASSWORD}" | ||
--health-interval 10s | ||
--health-start-period 10s | ||
--health-timeout 5s | ||
--health-retries 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Run tests | ||
run: GORAVEL_DATABASE=mysql bash .github/docker.sh | ||
|
||
postgres: | ||
strategy: | ||
matrix: | ||
dbversion: [ 'postgres:latest' ] | ||
go: | ||
- "stable" | ||
- "oldstable" | ||
platform: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.platform }} | ||
|
||
services: | ||
postgres: | ||
image: ${{ matrix.dbversion }} | ||
env: | ||
POSTGRES_PASSWORD: GoravelTest123 | ||
POSTGRES_USER: goravel | ||
POSTGRES_DB: goravel | ||
TZ: Asia/Shanghai | ||
ports: | ||
- 9920: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: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Run tests | ||
run: GORAVEL_DATABASE=postgres bash .github/docker.sh | ||
|
||
sqlserver: | ||
strategy: | ||
matrix: | ||
go: | ||
- "stable" | ||
- "oldstable" | ||
platform: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.platform }} | ||
|
||
services: | ||
mssql: | ||
image: mcmoe/mssqldocker:latest | ||
env: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: GoravelTest123 | ||
MSSQL_DB: goravel | ||
MSSQL_USER: goravel | ||
MSSQL_PASSWORD: GoravelTest123 | ||
ports: | ||
- 9930:1433 | ||
options: >- | ||
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -l 30 -Q \"SELECT 1\" || exit 1" | ||
--health-start-period 10s | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Run tests | ||
run: GORAVEL_DATABASE=sqlserver bash .github/docker.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters