Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit ff272f1

Browse files
authored
chore: only run jobs in packages that have changed since master (#2915)
Should make PR builds much faster.
1 parent af66e94 commit ff272f1

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.travis.yml

+17-15
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ addons:
4242
before_install:
4343
# prevents windows error: npm ERR! ... git-sh-setup: file not found
4444
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi
45+
# only run jobs in packages that have changed since master in PR builds
46+
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export RUN_SINCE='--since master' ; fi
4547

46-
script: npx nyc -s npm run test:node -- -- -- --timeout 10000 --bail
48+
script: npx nyc -s npm run test:node -- $RUN_SINCE -- -- --timeout 10000 --bail
4749
after_success:
4850
- npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
4951

@@ -60,77 +62,77 @@ jobs:
6062
include:
6163
- stage: check
6264
script:
63-
- npm run build -- --scope={ipfs,ipfs-http-client} -- -- --bundlesize
64-
- npm run dep-check -- -- -- -- -i wrtc -i electron-webrtc
65-
- npm run lint -- --concurrency 1
65+
- npm run build -- $RUN_SINCE --scope={ipfs,ipfs-http-client} -- -- --bundlesize
66+
- npm run dep-check -- $RUN_SINCE -- -- -- -i wrtc -i electron-webrtc
67+
- npm run lint -- $RUN_SINCE --concurrency 1
6668

6769
- stage: test
6870
name: chrome
6971
addons:
7072
chrome: stable
7173
script:
72-
- npm run test:browser -- -- -- --bail
74+
- npm run test:browser -- $RUN_SINCE -- -- --bail
7375

7476
- stage: test
7577
name: chrome webworker
7678
addons:
7779
chrome: stable
7880
script:
79-
- npm run test:webworker -- -- -- --bail
81+
- npm run test:webworker -- $RUN_SINCE -- -- --bail
8082

8183
- stage: test
8284
name: firefox
8385
addons:
8486
firefox: latest
8587
script:
86-
- npm run test:browser -- -- -- --bail --browsers FirefoxHeadless
88+
- npm run test:browser -- $RUN_SINCE -- -- --bail --browsers FirefoxHeadless
8789

8890
- stage: test
8991
name: firefox webworker
9092
addons:
9193
firefox: latest
9294
script:
93-
- npm run test:webworker -- -- -- --bail --browsers FirefoxHeadless
95+
- npm run test:webworker -- $RUN_SINCE -- -- --bail --browsers FirefoxHeadless
9496

9597
- stage: test
9698
name: electron-main
9799
os: osx
98100
script:
99-
- npm run test:electron-main -- -- -- --bail
101+
- npm run test:electron-main -- $RUN_SINCE -- -- --bail
100102

101103
- stage: test
102104
name: electron-renderer
103105
os: osx
104106
script:
105-
- npm run test:electron-renderer -- -- -- --bail
107+
- npm run test:electron-renderer -- $RUN_SINCE -- -- --bail
106108

107109
- stage: test
108110
name: interop - node
109111
script:
110-
- npm run test:interop:node -- -- -- --bail
112+
- npm run test:interop:node -- $RUN_SINCE -- -- --bail
111113

112114
- stage: test
113115
name: interop - browser
114116
script:
115-
- npm run test:interop:browser -- -- -- --bail
117+
- npm run test:interop:browser -- $RUN_SINCE -- -- --bail
116118

117119
- stage: test
118120
name: interop - electron-main
119121
os: osx
120122
script:
121-
- npm run test:interop:electron-main -- -- -- --bail --timeout 10000
123+
- npm run test:interop:electron-main -- $RUN_SINCE -- -- --bail --timeout 10000
122124

123125
- stage: test
124126
name: interop - electron-renderer
125127
os: osx
126128
script:
127-
- npm run test:interop:electron-renderer -- -- -- --bail --timeout 10000
129+
- npm run test:interop:electron-renderer -- $RUN_SINCE -- -- --bail --timeout 10000
128130

129131
- stage: test
130132
name: examples
131133
script:
132134
- npm run build -- --scope={ipfs,ipfs-http-client}
133-
- npm run test -- --scope=example* --concurrency=1
135+
- npm run test -- $RUN_SINCE --scope=example* --concurrency=1
134136

135137
- stage: release-rc
136138
# only run on changes to master

0 commit comments

Comments
 (0)