Skip to content

Commit

Permalink
try manual docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 28, 2024
1 parent a3f08a4 commit 1952ab4
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/cockroach-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ jobs:
fail-fast: false
timeout-minutes: 10

services:
cockroach:
image: cockroachdb/cockroach:v${{ matrix.cockroach_version }}
env:
DATABASE_URL: postgresql://root@localhost:26257/integration_test
# Set health checks to wait until cockroach has started
options: >-
--health-cmd "cockroach start --insecure --host=localhost"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 26257 on service container to the host
- 26257:26257

name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest'
steps:
- name: Checkout
Expand All @@ -59,13 +44,9 @@ jobs:

- name: Init Cockroach
run: |
dockerize -wait tcp://127.0.0.1:26257 -timeout 60s && node -e '
(new (require("pg").Pool)({ connectionString: process.env.DATABASE_URL }))
.query(
"CREATE DATABASE integration_test",
err => (process.exitCode = err ? 1 : 0) && process.stdout.write(err.stack)
)
'
docker pull cockroachdb/cockroach:v${{ matrix.cockroach_version }}
docker run -d --name roach --hostname roach -p 26257:26257 -p 8080:8080 cockroachdb/cockroach:v${{ matrix.cockroach_version }} start --insecure
docker exec roach bash -c "echo 'CREATE DATABASE integration_test;' | cockroach sql --insecure"
- name: Integration Test
run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps
Expand Down

0 comments on commit 1952ab4

Please sign in to comment.