This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
.travis.yml
50 lines (44 loc) · 2.1 KB
/
.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
language: java
dist: trusty
sudo: false
jdk:
- oraclejdk8
env:
- GH_URL=https://raw.githubusercontent.com VALIDATOR_URL=http://localhost:8080/api/debug?url FILE_TO_VALIDATE=beacon.yaml URL_TO_VALIDATE=$GH_URL/$TRAVIS_REPO_SLUG/${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}/$FILE_TO_VALIDATE
before_install:
# This setup will not be needed once the online version of validator-badge supports OAS 3.0. Until then we'll need to set up a local version. Since there isn't a release supporting OAS 3.0 yet, we unfortunately need to build some snapshot dependencies. These steps should be gradually removed as releases come out.
# build swagger-core
- git clone --branch=v2.0.2 https://github.com/swagger-api/swagger-core.git
- cd swagger-core
- git reset --hard 5336adb9945cfdf6eddbb61f15b28a1509e0b267
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- cd ..
# build swagger-parser
- git clone --branch=v2.0.0 https://github.com/swagger-api/swagger-parser.git
- cd swagger-parser
- git reset --hard 7ce0f756364acee3262444ab998e9fe0963382b3
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- cd ..
# build swagger-inflector
- git clone --branch=v1.0.16 https://github.com/swagger-api/swagger-inflector.git
- cd swagger-inflector
- git reset --hard 421fedb162b9e9b781671bc7757ee78eb6d1f793
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- cd ..
# build and start validator-badge
- git clone --branch=2.0 https://github.com/swagger-api/validator-badge.git
- cd validator-badge
- mvn package -DskipTests=true -Dmaven.javadoc.skip=true -B -V jetty:run &
- cd ..
- sleep 60
script:
# validate
- echo "Validating $URL_TO_VALIDATE:"
- VALIDATION_OUTPUT=`curl -sS "$VALIDATOR_URL=$URL_TO_VALIDATE"`
# print validation errors
- echo $VALIDATION_OUTPUT
# check if the validation output is an empty array, i.e. no errors
- test "$VALIDATION_OUTPUT" == "[]"
notifications:
slack:
secure: RmyIMB6tA868r+dHECJ566r0+TCB6pHvg9PygNiM5ye+iX4I+CFKMoGzjeMVtuLI80MSzzoaB+PU6TczlhzdbJBALqiV74AQCoNGqswJzJCkJX7HDGk8LVFSsnpwClRLLLVgvBApGDS0ViRfGqsew8CJ8VR5BMDiU53z3Of4JHc=