forked from Azure/autorest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
100 lines (99 loc) · 3.43 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
language: csharp
sudo: required
dist: trusty
addons:
apt:
sources:
- deadsnakes
packages:
# packages for python
- python3.5
env:
matrix:
- MODE=main
#- MODE=diffRegenExpected
#- MODE=diffRegenSpecsRepo
matrix:
fast_finish: true
allow_failures:
- env: MODE=diffRegenSpecsRepo
before_install:
# Attempt to work around fact that node modules mess up rvm
- PATH=`echo $PATH | sed "s/\.\/node_modules\/\.bin//g"`
- export PATH=$PATH:./node_modules/.bin
install:
# Install npm
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install 6.9.5
- npm install -g npm@'>=1.4.3'
- npm install
# Install runtime
- |-
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.0-rc4-004769 -y
# Install dev dependencies
- |-
if [[ $MODE == 'main' ]]; then
set -ex
set -o pipefail
# select JDK
jdk_switcher use oraclejdk8
# Install ruby dependencies
rvm use 2.3.0 --install
gem install bundler
bundle install
pip install --user tox
# Install go
sudo curl -O https://storage.googleapis.com/golang/go1.7.linux-amd64.tar.gz
sudo tar -xvf go1.7.linux-amd64.tar.gz > /dev/null
sudo mv go /usr/local/
export PATH=$PATH:/usr/local/go/bin
export GOPATH=`pwd`/src/generator/AutoRest.Go.Tests
sudo chmod -R 777 `echo $GOPATH`
sudo apt-get install git -y
sudo add-apt-repository ppa:masterminds/glide -y && sudo apt-get update
sudo apt-get install glide
fi
script:
- set -ex
- set -o pipefail
- gulp build
- |-
if [[ $MODE == 'main' ]]; then
gulp test
elif [[ $MODE == 'diffRegenExpected' ]]; then
gulp regenerate
git diff -w
! git diff -w | grep -q "@@"
elif [[ $MODE == 'diffRegenSpecsRepo' ]]; then
gens=(CSharp Azure.CSharp Azure.CSharp.Fluent Ruby Azure.Ruby NodeJS Azure.NodeJS Python Azure.Python Go Java Azure.Java Azure.Java.Fluent AzureResourceSchema)
specs=/tmp/repos/specs
arRef=/tmp/repos/autorest
# retrieve specs
git clone https://github.com/Azure/azure-rest-api-specs $specs
# prepare reference AutoRest
git clone https://github.com/Azure/autorest $arRef
pushd $arRef
npm install
gulp build
# REGEN using reference AutoRest
for gen in "${gens[@]}"
do
echo "REGENERATING FOR $gen"
find $specs -regex '[^/]*/[^/]*/.*/[^/]*.json' -exec gulp autorest -n Test -m Swagger -g $gen -i {} -o {}_Swagger > {}_Swagger/out.txt 2>&1 \;
find $specs -regex '[^/]*/[^/]*/.*/[^/]*.json' -exec gulp autorest -n Test -m CompositeSwagger -g $gen -i {} -o {}_CompositeSwagger > {}_CompositeSwagger/out.txt 2>&1 \;
done
fi
after_script:
- |-
if [[ $MODE == 'main' ]]; then
echo "========== Server log: ============"
pwd
ls -al
ls -al TestResults
cat TestResults/*.log
fi
notifications:
slack:
secure: d0PFVLcyqcMxNtmZ8JaEpIBzXbUbZCgKs8QtBB5qEIXDnxflSR3AhczlILNhTBKtMEBlwVzsz65yP09XcmvB6xpAfJbHqSRzk2frKa5viPcAD8Wr/NYamt9/UiTCsnql8MqzjVy0tLdMscXKRmsUey4YF570zl0b7gAbq7XTqxM=