Skip to content

Commit 544dc96

Browse files
Copilotbytemain
andcommitted
Update e2e workflow vfox install flow
Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent fa66847 commit 544dc96

1 file changed

Lines changed: 48 additions & 9 deletions

File tree

.github/workflows/e2e.yaml

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,52 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18+
- name: Compress build files
19+
uses: thedoctor0/zip-release@0.7.6
20+
with:
21+
type: "zip"
22+
directory: "./"
23+
filename: "release.zip"
24+
exclusions: ".git/** .gitignore .github/** README.*"
1825
- name: Install vfox
19-
uses: version-fox/install-vfox-action@v1
20-
- name: Add java plugin from repo
21-
run: vfox add --source "${GITHUB_WORKSPACE}" java
22-
- name: Search java versions
23-
run: vfox search java tem
24-
- name: Install Java
25-
run: vfox install java@17.0.17-tem
26-
- name: Verify Java install
27-
run: vfox list java
26+
shell: bash
27+
run: |
28+
set -euo pipefail
29+
install_script="$(mktemp)"
30+
# Pinned install.sh from the v1.0.3 tag (commit below); verify with:
31+
# git ls-remote https://github.com/version-fox/vfox.git refs/tags/v1.0.3^{}
32+
install_commit="0006386f97ed08d4eca5917ba6ace2736f31fb5f"
33+
# SHA256 from: curl -sS https://raw.githubusercontent.com/version-fox/vfox/${install_commit}/install.sh | sha256sum
34+
# Recalculate this hash when updating or auditing the pinned script.
35+
install_sha="7b11beb7b826ab50e46c85a09e26f1c9b8a7ee7e71d3ea4c2588fe413ed0e210"
36+
curl -sSLo "$install_script" "https://raw.githubusercontent.com/version-fox/vfox/${install_commit}/install.sh"
37+
echo "${install_sha} ${install_script}" | sha256sum -c -
38+
max_retries=10
39+
retry_delay=5
40+
# Retry install for up to 10 attempts (5s delay) to handle transient network issues (up to 45s delay).
41+
installed=false
42+
for attempt in $(seq 1 "$max_retries"); do
43+
if bash "$install_script"; then
44+
installed=true
45+
break
46+
fi
47+
if [ "$attempt" -lt "$max_retries" ]; then
48+
sleep "$retry_delay"
49+
fi
50+
done
51+
rm -f "$install_script"
52+
if [ "$installed" != "true" ]; then
53+
echo "Failed to install vfox"
54+
exit 1
55+
fi
56+
vfox --version
57+
- name: Install plugin
58+
run: vfox add --source "${GITHUB_WORKSPACE}/release.zip" java
59+
- name: Install Java 17.0.17-tem
60+
run: |
61+
set -euo pipefail
62+
eval "$(vfox activate bash)"
63+
vfox search java tem
64+
vfox install java@17.0.17-tem
65+
vfox use -g java@17.0.17-tem
66+
vfox current

0 commit comments

Comments
 (0)