From ddf2744d001376e36cb24dc8422a36e10059b08c Mon Sep 17 00:00:00 2001 From: tom-shan Date: Thu, 6 Jun 2019 15:42:32 +0800 Subject: [PATCH] add ripgrep to travis ci cache directories list 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 --- .travis.yml | 1 + scripts/prepare-travis | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index b70d3ddc5260a..6842230848d65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/scripts/prepare-travis b/scripts/prepare-travis index d622e29b5e37b..85dccbe1700f3 100644 --- a/scripts/prepare-travis +++ b/scripts/prepare-travis @@ -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;