Skip to content

Commit e85f257

Browse files
committed
Use Docker to start a Postgres service
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 1472ea3 commit e85f257

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/run-unit-tests-macos.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
POSTGRES_PASSWORD: scancodeio
1414

1515
jobs:
16-
macos-test:
16+
run-unit-tests:
1717
runs-on: macos-13
1818

1919
strategy:
@@ -29,13 +29,13 @@ jobs:
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131

32-
- name: Install dependencies with Homebrew
32+
- name: Start Postgres container
3333
run: |
34-
brew update
35-
brew install universal-ctags gettext postgresql
36-
brew services start postgresql
37-
sleep 5
38-
createdb $POSTGRES_DB || echo "Database may already exist"
34+
docker run -d --name test-postgres -e POSTGRES_USER=scancodeio -e POSTGRES_PASSWORD=scancodeio -e POSTGRES_DB=scancodeio -p 5432:5432 postgres:13
35+
36+
- name: Wait for Postgres to be ready
37+
run: |
38+
until pg_isready -h localhost -p 5432; do sleep 1; done
3939
4040
- name: Install Python dependencies
4141
run: make dev envfile

0 commit comments

Comments
 (0)