From 2bf2a8ca26ffa8cc064df8d40e9846207ef46cae Mon Sep 17 00:00:00 2001 From: uzlopak Date: Fri, 5 Jan 2024 23:12:40 +0100 Subject: [PATCH] test: docker-in-docker --- .github/workflows/ci.yml | 2 +- package.json | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ed9c7e..7b00276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ on: jobs: test: - uses: fastify/workflows/.github/workflows/plugins-ci-postgres.yml@v3 + uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3 with: license-check: true lint: true diff --git a/package.json b/package.json index d9cae34..5bf3602 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "check-examples": "tsc --build examples/typescript/*", "lint": "standard", "lint:fix": "standard --fix", - "load-data": "docker exec -it fastify-postgres psql -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres -d postgres", - "postgres": "docker run -p 5432:5432 --name fastify-postgres -e POSTGRES_PASSWORD=postgres -d postgres:11-alpine", + "postgres:init": "docker exec fastify-postgres psql -c 'CREATE TABLE users(id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);' -U postgres -d postgres", + "postgres:start": "docker run -p 5432:5432 --name fastify-postgres -e POSTGRES_PASSWORD=postgres -d postgres:11-alpine", + "postgres:stop": "docker rm fastify-postgres", + "pretest": "if [ -n \"$CI\" ]; then npm run postgres:start; fi", "test": "npm run test:unit && npm run test:typescript", "test:unit": "tap -J test/*.test.js", "test:report": "standard && tap -J --coverage-report=html test/*.test.js",