forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (104 loc) · 3.12 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
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
100
101
102
103
104
language: node_js
node_js:
- '8'
services:
- docker
env:
matrix:
- MODE=branchStrategy
- MODE=syntax
- MODE=python
- MODE=node
- MODE=ruby
- MODE=java
- MODE=go
- MODE=semantic PR_ONLY=true
- MODE=semantic PR_ONLY=false
- MODE=model PR_ONLY=false
- MODE=linter PR_ONLY=true
- MODE=model PR_ONLY=true
- MODE=BreakingChange PR_ONLY=true
- MODE=azurebot PR_ONLY=true
- MODE=liveValidation PR_ONLY=true
matrix:
fast_finish: true
allow_failures:
- env: MODE=semantic PR_ONLY=false
- env: MODE=model PR_ONLY=false
- env: MODE=linter PR_ONLY=true
- env: MODE=model PR_ONLY=true
- env: MODE=BreakingChange PR_ONLY=true
- env: MODE=azurebot PR_ONLY=true
- env: MODE=liveValidation PR_ONLY=true
- env: MODE=java
- env: MODE=ruby
- env: MODE=go
- env: MODE=node
before_install:
- docker pull lmazuel/swagger-to-sdk
- python -c "import os; print('\n'.join(v for v in os.environ.keys() if v.startswith('TRAVIS')))" > /tmp/env_file
# Required for installing dotnet 2.0.0 according to https://www.microsoft.com/net/core#linuxubuntu
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-get update
- sudo apt-get install libunwind8 libicu52 -y
- sudo apt-get install dotnet-sdk-2.0.0 -y
install:
- npm install
script:
- DOCKER_CMD="docker run --rm --env-file /tmp/env_file -e GH_TOKEN -v $PWD:/git-restapi/ lmazuel/swagger-to-sdk"
- >-
if [[ $MODE == 'python' ]]; then
$DOCKER_CMD Azure/azure-sdk-for-python -v
fi
- >-
if [[ $MODE == 'node' ]]; then
travis_wait 30 $DOCKER_CMD Azure/azure-sdk-for-node -v
fi
- >-
if [[ $MODE == 'ruby' ]]; then
$DOCKER_CMD Azure/azure-sdk-for-ruby -v
fi
- >-
if [[ $MODE == 'go' ]]; then
$DOCKER_CMD Azure/azure-sdk-for-go -o latest -v
fi
- >-
if [[ $MODE == 'java' ]]; then
$DOCKER_CMD Azure/azure-libraries-for-java -v
fi
- >-
if [[ $MODE == 'branchStrategy' ]]; then
# Check to ensure CI is not executing for a PR against the master branch in the private repository
! [[ $TRAVIS_PULL_REQUEST != 'false' && $TRAVIS_REPO_SLUG == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]]
fi
- >-
if [[ $MODE == 'syntax' ]]; then
npm test -- test/syntax.js
fi
- >-
if [[ $MODE == 'linter' ]]; then
npm test -- test/linter.js
fi
- >-
if [[ $MODE == 'semantic' ]]; then
npm test -- test/semantic.js
fi
- >-
if [[ $MODE == 'model' ]]; then
npm test -- test/model.js
fi
- >-
if [[ $MODE == 'BreakingChange' ]]; then
node -- scripts/breaking-change.js
fi
- >-
if [[ $MODE == 'azurebot' ]]; then
node scripts/momentOfTruth.js
node scripts/momentOfTruthPostProcessing.js
fi
- >-
if [[ $MODE == 'liveValidation' ]]; then
node -- scripts/liveValidation.js;
fi