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 committed Jun 6, 2019
1 parent 61bb0f1 commit ddf2744
Show file tree
Hide file tree
Showing 2 changed files with 9 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
8 changes: 8 additions & 0 deletions scripts/prepare-travis
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ for (const name in workspaces) {
}
}

const ripgrepVersions = child_process.execSync('yarn list --pattern vscode-ripgrep | grep -o "vscode-ripgrep@.*" | cut -d @ -f 2')
.toString().trim().split(os.EOL);
for (const i in ripgrepVersions) {
const rv = ripgrepVersions[i];
const ripgrepPath = '/tmp/vscode-ripgrep-cache-' + rv;
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 ddf2744

Please sign in to comment.