forked from danger/danger-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
100 lines (87 loc) · 3.5 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: node_js
cache:
yarn: true
directories:
- node_modules
- .jest/cache
matrix:
include:
# Normal CI test runs :D
- node_js: "10"
- node_js: "8"
after_script:
- echo "Validating TypeScript definition file"
- yarn build
- yarn declarations
- yarn tsc distribution/danger.d.ts
- rm -rf node_modules/@types/babel-*
- rm -rf node_modules/@types/babylon
- echo "Testing Flow definition file"
- yarn build:flow-types
- yarn flow check
# Checks every example dangerfile can run in `danger runner`.
- node_js: "8"
script:
- yarn build
- node scripts/run-fixtures.js
# Runs both the CI and PR with a custom process to ensure apps like swift/rust work
- node_js: "10.13"
script:
- yarn build
- node distribution/commands/danger-ci.js --process "ruby scripts/danger_runner.rb"
- node distribution/commands/danger-pr.js --process "ruby scripts/danger_runner.rb"
https://github.com/danger/danger-js/pull/760
# Does the real danger run
- node_js: "node"
script:
- yarn jest --outputFile test-results.json --json --runInBand
- yarn run link
# If the PR is odd then run using issue commenting, else use checks
# - |
# if [ $(($TRAVIS_PULL_REQUEST % 2)) -eq 0 ];
# then
# echo "This is the real `danger ci` run on this repo, using issues";
# DEBUG="*" danger ci --verbose;
# else
# echo "This is the real `danger ci` run on this repo, using github checks with a custom app";
# DEBUG="*" DANGER_GITHUB_APP_ID=12482 danger ci --verbose;
#
# echo "This is the real `danger ci` run on this repo, using github checks with the danger app";
# DEBUG="*" DANGER_JS_APP_INSTALL_ID=177994 danger ci --verbose;
# fi
- DEBUG="*" DANGER_GITHUB_APP_ID=12482 danger ci --verbose;
- echo "Validating that danger pr works as expected"
- DEBUG="*" danger pr https://github.com/danger/danger-js/pull/465 --dangerfile dangerfile.circle.js --verbose
- echo "Grabbing master so that danger-local can use it for comparison"
- git checkout -t origin/master || true
- '[ ! -z $TRAVIS_PULL_REQUEST ] && DEBUG="*" danger local --dangerfile
source/platforms/git/_tests/local_dangerfile_example.ts || echo "Skipping Danger Local for non PR run"'
# Create some fake projects at runtime
- node_js: "10.16"
script:
- echo "This is only for Integration tests on two blank projects"
- yarn build
- mkdir danger_blank_test
- cd danger_blank_test
- yarn init --yes
- yarn add file:..
- echo "warn('I warned you')" > dangerfile.js
- echo "Testing a blank Dangerfile on an empty project"
- DEBUG="*" yarn danger run --text-only
- cd ..
- rm -rf danger_blank_test
- npm install -g create-react-app
- create-react-app danger_babel_test
- cd danger_babel_test
- yarn add file:..
- echo "warn('Expect 2 warnings'); const a = async () => {warn('the other');}; schedule(a)" > dangerfile.js
- echo "Testing a blank Dangerfile on a babel CRA project"
- DEBUG="*" yarn danger ci --text-only
- cd ..
- rm -rf danger_babel_test
script:
- yarn lint
- yarn add jest
- yarn jest --runInBand
notifications:
slack: dangergem:9FOZou9EGBV9xO1Ol4bxRPz9