-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
99 lines (87 loc) · 1.85 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
###########
# ANCHORS #
###########
.mr-only:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
.sb-job:
image: registry.0xacab.org/team-friendo/signalboost/signalboost:latest
extends: .mr-only
cache:
key: sb_build
paths:
- node_modules
- .yarn
before_script:
- yarn config set cache-folder .yarn
- yarn install
variables:
NODE_ENV: test
POSTGRES_DB: signalboost_test
.sc-job:
image:
name: registry.0xacab.org/team-friendo/signalboost/signalc-dev:latest
entrypoint: [""]
extends: .mr-only
cache:
key: sc_build
paths:
- .gradle
- signalc/build
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
variables:
SIGNALC_ENV: test # TODO: let's change this to `ci` soon?
POSTGRES_DB: signalc_test
SIGNALC_DB_NAME: signalc_test
.uses-postgres:
services:
- name: postgres:12
alias: db
variables:
DB_HOST: db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
POSTGRES_HOST_AUTH_METHOD: trust
##########
# STAGES #
##########
stages:
- test
# - deploy (coming soon!)
########
# JOBS #
########
sb:lint:
stage: test
extends:
- .sb-job
script:
- npx eslint app && npx eslint test
sb:unit:
stage: test
extends:
- .sb-job
- .uses-postgres
script:
- npx sequelize db:migrate --env test
- find test/unit -name '*.spec.js' | shuf | xargs npx mocha -R spec -r babel-register --reporter dot --exit
sb:integration:
stage: test
extends:
- .sb-job
- .uses-postgres
variables:
INTEGRATION_TEST: 1
script:
- npx sequelize db:migrate --env test
- find test/integration -name '*.spec.js' | shuf | xargs npx mocha -R spec -r babel-register --reporter dot --exit
sc:test:
stage: test
extends:
- .sc-job
- .uses-postgres
script:
- cd signalc
- gradle update
- gradle test