diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d0d637f..b5c5c00c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,8 +43,7 @@ jobs: image: $IMAGE_NAME:$DOCKER_METADATA_OUTPUT_VERSION" > docker-compose.ci.yml - name: "Run tests" - run: | - docker compose -f docker-compose.testing.yml -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from activitypub + run: yarn test - name: Login to GAR uses: docker/login-action@v3 diff --git a/docker-compose.testing.yml b/docker-compose.testing.yml deleted file mode 100644 index b99dfcbb..00000000 --- a/docker-compose.testing.yml +++ /dev/null @@ -1,31 +0,0 @@ -services: - activitypub: - build: . - environment: - - MYSQL_USER=ghost - - MYSQL_PASSWORD=password - - MYSQL_HOST=mysql-testing - - MYSQL_PORT=3306 - - MYSQL_DATABASE=activitypub - - NODE_ENV=testing - command: yarn test:all - depends_on: - mysql-testing: - condition: service_healthy - - mysql-testing: - image: mysql:lts - volumes: - - mysql-test-volume:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_USER=ghost - - MYSQL_PASSWORD=password - - MYSQL_DATABASE=activitypub - healthcheck: - test: "mysql -ughost -ppassword activitypub -e 'select 1'" - interval: 1s - retries: 120 - -volumes: - mysql-test-volume: diff --git a/package.json b/package.json index c85016d4..8626a71f 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,15 @@ "main": "src/app.ts", "type": "module", "scripts": { - "dev": "docker compose up", + "dev": "docker compose up -d --no-recreate", + "dev:record": "docker compose --env-file record.env up", + "logs": "docker compose logs activitypub -f", + "test": "yarn dev && docker compose exec activitypub yarn test:all", "test:types": "tsc --noEmit", "test:unit": "c8 --src src --all --reporter text --reporter cobertura mocha -r tsx './src/**/*.unit.test.ts'", "test:integration": "c8 --src src --all --reporter text --reporter cobertura mocha -r tsx './src/**/*.integration.test.ts'", "test:code": "c8 --src src --all --reporter text --reporter cobertura mocha -r tsx './src/**/*.test.ts'", "test:all": "yarn test:types && yarn test:code", - "test": "docker compose -f docker-compose.testing.yml up --abort-on-container-exit --exit-code-from activitypub", "lint:code": "eslint *.js lib/ --ext .js --cache", "lint": "yarn lint:code" },