Try to be clever about service ports
This commit is contained in:
parent
c0177a850f
commit
5212bcb787
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
|||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_DB: dataset
|
POSTGRES_DB: dataset
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432/tcp
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
mariadb:
|
mariadb:
|
||||||
image: mariadb
|
image: mariadb
|
||||||
@ -24,7 +24,7 @@ jobs:
|
|||||||
MYSQL_DATABASE: dataset
|
MYSQL_DATABASE: dataset
|
||||||
MYSQL_ROOT_PASSWORD: mariadb
|
MYSQL_ROOT_PASSWORD: mariadb
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- 3306/tcp
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -49,12 +49,12 @@ jobs:
|
|||||||
make test
|
make test
|
||||||
- name: Run PostgreSQL tests
|
- name: Run PostgreSQL tests
|
||||||
env:
|
env:
|
||||||
DATABASE_URI: 'postgresql+psycopg2://postgres:postgres@postgres/dataset'
|
DATABASE_URI: 'postgresql+psycopg2://postgres:postgres@postgres:${{ job.services.postgres.ports[5432] }}/dataset'
|
||||||
run: |
|
run: |
|
||||||
make test
|
make test
|
||||||
- name: Run MariaDB tests
|
- name: Run MariaDB tests
|
||||||
env:
|
env:
|
||||||
DATABASE_URI: 'mysql+pymysql://mariadb:mariadb@mariadb/dataset?charset=utf8'
|
DATABASE_URI: 'mysql+pymysql://mariadb:mariadb@mariadb:${{ job.services.mariadb.ports[3306] }}/dataset?charset=utf8'
|
||||||
run: |
|
run: |
|
||||||
make test
|
make test
|
||||||
- name: Build a distribution
|
- name: Build a distribution
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user