Merge pull request 'Added drone pipeline that automaticly runs on prs (or at least it should)' (#27) from feature/23-tests_on_pr into dev

Reviewed-on: #27
closes #23
This commit is contained in:
Nicolai Ort 2020-12-11 19:33:40 +00:00
commit 1e625b0775
3 changed files with 31 additions and 1 deletions

20
.drone.yml Normal file
View File

@ -0,0 +1,20 @@
---
kind: pipeline
name: tests:latest
clone:
disable: true
steps:
- name: checkout pr
image: alpine/git
commands:
- git clone $DRONE_REMOTE_URL .
- git checkout $DRONE_SOURCE_BRANCH
- mv .env.ci .env
- name: run tests
image: node:alpine
commands:
- yarn
- yarn test:ci
trigger:
event:
- pull_request

8
.env.ci Normal file
View File

@ -0,0 +1,8 @@
APP_PORT=4010
DB_TYPE=sqlite
DB_HOST=unused
DB_PORT=unused
DB_USER=unused
DB_PASSWORD=bla
DB_NAME=./test.sqlite
NODE_ENV=production

View File

@ -59,6 +59,7 @@
"jest": "^26.6.3",
"nodemon": "^2.0.6",
"sqlite3": "^5.0.0",
"start-server-and-test": "^1.11.6",
"ts-jest": "^26.4.4",
"ts-node": "^9.0.0",
"typedoc": "^0.19.2",
@ -69,7 +70,8 @@
"build": "tsc",
"docs": "typedoc --out docs src",
"test": "jest",
"test:watch": "jest --watchAll"
"test:watch": "jest --watchAll",
"test:ci": "start-server-and-test dev http://localhost:4010/api/openapi.json test"
},
"nodemonConfig": {
"ignore": [