Skip to content

Commit

Permalink
add ripgrep to travis ci cache directories list
Browse files Browse the repository at this point in the history
CI often fails for the github api rate limit when downloading ripgrep
package. This workaroud is trying to enable Travis CI cache of the
ripgrep package and lower the failure rate.

Signed-off-by: tom-shan <swt0008411@163.com>
  • Loading branch information
tom-shan authored and akosyakov committed Jun 6, 2019
1 parent 25fa87e commit 393aa6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cache:
# All directories need to be listed here, because Travis does not support globs.
# Auto generated by scripts/prepare-travis
# start_cache_directories
- /tmp/vscode-ripgrep-cache-1.2.4
- dev-packages/application-manager/node_modules
- dev-packages/application-package/node_modules
- dev-packages/electron/node_modules
Expand Down
7 changes: 7 additions & 0 deletions scripts/prepare-travis
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ for (const name in workspaces) {
}
}

const yarnList = child_process.execSync('yarn list -s --pattern vscode-ripgrep').toString();
const regexp = new RegExp('vscode-ripgrep@(.*)', 'g');
while (match = regexp.exec(yarnList)) {
const ripgrepPath = '/tmp/vscode-ripgrep-cache-' + match[1].trim();
directories.push(ripgrepPath);
}

const travisPath = path.resolve(__dirname, '../.travis.yml');
const content = fs.readFileSync(travisPath).toString();
const startIndex = content.indexOf('# start_cache_directories') + '# start_cache_directories'.length;
Expand Down

0 comments on commit 393aa6a

Please sign in to comment.