Skip to content

Commit e6e080c

Browse files
author
Akash Satheesan
committed
chore(ci): update vscode cache logic
1 parent 209dcd9 commit e6e080c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ jobs:
8383
# use this to avoid rebuilding it if nothing changed
8484
- name: Get latest lib/vscode rev
8585
id: vscode-rev
86-
run: echo "::set-output name=rev::$(git log -1 --format='%H' lib/vscode)"
86+
run: |
87+
./ci/steps/git-deepen.sh
88+
echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode)"
8789
8890
- name: Attempt to fetch vscode build from cache
8991
id: cache-vscode
@@ -165,7 +167,7 @@ jobs:
165167
test-e2e:
166168
name: End-to-end tests
167169
needs: linux-amd64
168-
runs-on: ubuntu-16.04
170+
runs-on: ubuntu-latest
169171
env:
170172
PASSWORD: e45432jklfdsab
171173
CODE_SERVER_ADDRESS: http://localhost:8080

ci/steps/git-deepen.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# progressively deepen a clone until we reach a non-grafted commit.
5+
# used for getting the last lib/vscode commit for caching builds
6+
# without pulling the whole git history for performance reasons.
7+
main() {
8+
cd "$(dirname "$0")/../.."
9+
10+
while git log -1 --oneline --decorate lib/vscode | grep grafted; do
11+
git fetch --deepen=10
12+
done
13+
}
14+
15+
main "$@"

0 commit comments

Comments
 (0)