File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ dist: focal
3
3
jobs :
4
4
include :
5
5
- stage : test
6
- name : " Golang build and test "
6
+ name : " Golang build and tests "
7
7
language : go
8
8
env :
9
9
- GO111MODULE=on
@@ -16,11 +16,11 @@ jobs:
16
16
- make test
17
17
18
18
- stage : test
19
- name : " Node.js test "
19
+ name : " Node.js tests "
20
20
language : node_js
21
21
node_js :
22
22
- lts/*
23
23
env :
24
24
- NODE_ENV=test
25
25
script :
26
- - make test-frontend
26
+ - make test-frontend-ci
Original file line number Diff line number Diff line change @@ -152,10 +152,22 @@ build-frontend:
152
152
153
153
.PHONY : test-frontend
154
154
test-frontend :
155
+ NODE_ENV=test cd webapp-admin && \
156
+ npm install && \
157
+ npm install -g codecov && \
158
+ npm run test
159
+
160
+ IS_WEB_BUILD =$(shell ./web-build.sh)
161
+ .PHONY : test-frontend-ci
162
+ test-frontend-ci :
163
+ ifneq (, $(IS_WEB_BUILD ) )
164
+ @echo "run frontend tests"
165
+ @echo $(IS_WEB_BUILD)
155
166
NODE_ENV=test cd webapp-admin && \
156
167
npm install && \
157
168
npm install -g codecov && \
158
169
npm run test:ci
170
+ endif
159
171
160
172
# run application/db in docker
161
173
.PHONY : run-docker
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # This script is used from the Makefile/TravisCI in order to find out if
4
+ # some changes where done in webapp-admin/ directory or not.
5
+ # In the positive case Makefile will run frontend tests from webapp-admin/ directory.
6
+
7
+ set -e
8
+
9
+ CHANGED_FILES=` git diff --name-only master`
10
+ IS_WEB_BUILD=False
11
+ WEB_PATH=" webapp-admin/*"
12
+
13
+ for CHANGED_FILE in $CHANGED_FILES ; do
14
+ if [[ $CHANGED_FILE =~ $WEB_PATH ]]; then
15
+ IS_WEB_BUILD=True
16
+ break
17
+ fi
18
+ done
19
+
20
+ if [[ $IS_WEB_BUILD == True ]]; then
21
+ echo " yes"
22
+ fi
You can’t perform that action at this time.
0 commit comments