add test step to CI

This commit is contained in:
andyk 2020-08-21 15:11:01 +03:00
parent d2848105f7
commit 2cc6aa9974
4 changed files with 32 additions and 1 deletions

16
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,16 @@
stages:
- test
test:
stage: test
when:
- production
tags:
- aave-build-runner
before_script:
- docker-compose -f docker-compose.test.yml build
script:
- docker-compose -f docker-compose.test.yml run contracts-env npm run test
after_script:
- docker-compose -f docker-compose.test.yml run contracts-env npm run ci:clean
- docker-compose -f docker-compose.test.yml down

7
Dockerfile_test Normal file
View File

@ -0,0 +1,7 @@
FROM node:13
WORKDIR /app
ADD ./package-lock.json ./package.json /app/
RUN npm ci
ADD ./ /app/

7
docker-compose.test.yml Normal file
View File

@ -0,0 +1,7 @@
version: "3.5"
services:
dlp-contracts:
build:
context: ./
dockerfile: ./Dockerfile_test
command: npm run test

View File

@ -16,7 +16,8 @@
"dev:coverage": "buidler coverage", "dev:coverage": "buidler coverage",
"dev:deployment": "buidler dev-deployment", "dev:deployment": "buidler dev-deployment",
"dev:deployExample": "buidler deploy-Example", "dev:deployExample": "buidler deploy-Example",
"dev:prettier": "prettier --write ." "dev:prettier": "prettier --write .",
"ci:clean": "rm -rf ./artifacts ./cache ./types"
}, },
"devDependencies": { "devDependencies": {
"@nomiclabs/buidler": "1.4.4", "@nomiclabs/buidler": "1.4.4",