This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
65 lines (60 loc) · 2.29 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
sudo: false
language: python
python: 3.6
env:
global:
- GH_ORG=aio-libs
- secure: >-
chxALLrkss/vGGAAifuX3ocffVfzouzJWszG5vs3hRYnEhY4qAdaSHiW/+h75+EIWALdXB9dT8sep3FV6wVGyKmFW9+AwHOAW/zEMCPIvcXeYvqh19oUfhgjdHvjVuSCZmYIR3sdYB9uclo06boHkqXLukV2ldfRxose9F8tMILHrYXiUfmDgOsEyNDZXAdHIpR7g2JGyPK3NdIwDxQm7wOZwFGku6nE97wKfpe9SMHUu3fGdXuT98v48oi23lOI4CdesLqZxaaMRr2/bB0YkZHAcGCWRtET1KojzlRUCG6/XHi5qWaeLlHUO2U8roG+LAMtRtd+7rKtnG7q0WeX01fQB3GpDQ3jF7o1iemBSAEByiB8yX4UgRxGia/s/Y7qbLk8vUN5p4PThNi1NpxwHhpCEWQUXtTq+vNGJodAEYQ+WGjyBGVMKj5WO8wFDbrqFXU0pQA2fCgv9PvKhKV0a0nXzX+N6An5pjJj6HOtZ+Rg5WVx3Nw9iMkgSt56MU7u7z5wulG/wQQhHSEpyQOhV97slLLSW0xN6lQX0G/qXbcCuppC2bHB5ZbEs3eMQuRUoBnEeTGIQVCjzmzTFkKbkkbE5bpoeO3kixKEF1qjb2ruOXZiCtyuOUdyrSLk2cUXQsIyGwPX7bLxUNTtH4Mrj4kiNozleyTMbqk17bqso7A=
cache: pip
before_install:
- envsubst < .netrc.tmpl > .netrc
- unset GH_TOKEN
- >-
curl --netrc-file .netrc -s https://api.github.com/user | jq -r '"Logged in as @" + .login + " (" + .name + ")."'
install:
- python -m pip install yq
- >-
curl --netrc-file .netrc -s https://api.github.com/orgs/${GH_ORG}/repos?per_page=9999 | jq -r '.[].full_name' > .repos_list
after_install:
- rm -f .netrc
script:
- |-
COLOR_CONTROL="\e["
COLOR_RESET="${COLOR_CONTROL}0m"
COLOR_BOLD="${COLOR_CONTROL}1m"
COLOR_GREEN="${COLOR_BOLD}${COLOR_CONTROL}32m"
COLOR_RED="${COLOR_BOLD}${COLOR_CONTROL}31m"
COLOR_LIGHT_GREY="${COLOR_RESET}${COLOR_CONTROL}37m"
fail_flag=0
for repo in `cat .repos_list`
do
>&2 echo -e $COLOR_LIGHT_GREY
>&2 echo -n Checking ${repo}... ' '
travis_yml="https://raw.githubusercontent.com/${repo}/master/.travis.yml"
curl -s "$travis_yml" | python -m yq '' > /dev/null
check_result=$?
if [ "$check_result" -eq 0 ]
then
status_prefix=
>&2 echo -n -e "$COLOR_BOLD$COLOR_GREEN"
else
status_prefix='IN'
fail_flag=1
>&2 echo -n -e "$COLOR_RED"
fi
>&2 echo [ ${status_prefix}VALID ]
done
>&2 echo -e "$COLOR_LIGHT_GREY"
>&2 echo Repos checked.
if [ "$fail_flag" -eq 0 ]
then
>&2 echo -n -e "$COLOR_GREEN"
>&2 echo All repos have valid configs.
>&2 echo -n -e "$COLOR_RESET"
else
>&2 echo -n -e "$COLOR_RED"
>&2 echo At least one repo has invalid YAML markup in .travis.yml in master
>&2 echo -n -e "$COLOR_RESET"
exit $fail_flag
fi