forked from openwisp/OpenWISP-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
31 lines (28 loc) · 918 Bytes
/
.travis.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
language: python
node_js: "stable"
cache: pip
python: 3.6
before_install:
- npm install -g npm@latest
install:
- npm install -g htmlhint
- npm install -g jshint
- npm install -g stylelint
- pip install pylinkvalidator
- pip install https://github.com/openwisp/openwisp-utils/tarball/master
script:
- htmlhint **/*.html *.html --config htmlhint.conf
- jshint ./js/*.js --config .jshint
- stylelint "css/*.css" --config .stylelintrc.json
- python -m http.server 8001 &> /dev/null & pid=$!
- sleep 5
- pylinkvalidate.py http://localhost:8001/
- kill "${pid}"
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
# gets commit message of last commit before pull request merge
COMMIT_MESSAGE=$(git log $TRAVIS_PULL_REQUEST_SHA --format=%B -n 1)
printf "Checking commit message:\n\n"
printf "$COMMIT_MESSAGE\n\n"
checkcommit --message "$COMMIT_MESSAGE"
fi