File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,24 @@ jobs:
1717 os : ubuntu-latest
1818 - version : ' 5.0.0'
1919 expected-version : ' 5.0.0'
20- os : macos-latest
20+ os : macos-13 # x86_64
2121
2222 - expected-version : ' 10.0.0'
2323 os : ubuntu-latest
2424 - expected-version : ' 10.0.0'
25- os : macos-latest
25+ os : macos-13 # x86_64
26+ - expected-version : ' 10.0.0'
27+ os : macos-latest # arm64
28+
29+ - version : ' ee4c728d94b10437f41edf564650ac63cd0c0c5d'
30+ expected-version : ' 10.0.0'
31+ os : ubuntu-latest
32+ - version : ' ee4c728d94b10437f41edf564650ac63cd0c0c5d'
33+ expected-version : ' 10.0.0'
34+ os : macos-13 # x86_64
35+ - version : ' ee4c728d94b10437f41edf564650ac63cd0c0c5d'
36+ expected-version : ' 10.0.0'
37+ os : macos-latest # arm64
2638
2739 steps :
2840 - name : Checkout
4254 expected_pocket_ic_server_ver="pocket-ic-server ${{ matrix.expected-version }}"
4355
4456 if [ "$actual_pocket_ic_server_ver" != "$expected_pocket_ic_server_ver" ]; then
45- echo "Error: expected PocketIC server version '$expected_pocket_ic_server_ver', but '$actual_pocket_ic_server_ver' found "
57+ echo "Error: expected PocketIC server version '$expected_pocket_ic_server_ver', but got '$actual_pocket_ic_server_ver'"
4658 exit 1
4759 fi
4860 echo "PocketIC server version '$actual_pocket_ic_server_ver' was installed correctly"
Original file line number Diff line number Diff line change 1111 using : composite
1212 steps :
1313 - name : Install PocketIC server
14- shell : sh
14+ shell : bash
1515 run : |
1616 export POCKET_IC_VERSION="${{ inputs.pocket-ic-server-version }}"
1717
@@ -26,11 +26,30 @@ runs:
2626 exit 1
2727 fi
2828
29+ if [ "${{ runner.arch }}" = 'X64' ]; then
30+ export ARCH="x86_64"
31+ elif [ "${{ runner.arch }}" = 'ARM64' ]; then
32+ export ARCH="arm64"
33+ else
34+ echo "Unsupported CPU architecture."
35+ exit 1
36+ fi
37+
38+ # if `${POCKET_IC_VERSION}` is a git hash, then use CDN;
39+ # otherwise use a GitHub release.
40+ if [[ "${POCKET_IC_VERSION}" =~ ^[0-9a-f]{40,40}$ ]]; then
41+ URL="https://download.dfinity.systems/ic/${POCKET_IC_VERSION}/binaries/${ARCH}-${OS}/pocket-ic.gz"
42+ else
43+ URL="https://github.com/dfinity/pocketic/releases/download/${POCKET_IC_VERSION}/pocket-ic-${ARCH}-${OS}.gz"
44+ fi
45+
2946 echo "OS is $OS"
47+ echo "ARCH is $ARCH"
48+ echo "URL is $URL"
3049
3150 # Retry up to 10 times. Each attempt has 20 seconds total to complete, 5 seconds of which is to connect.
3251 # This uses the default retry delay, which starts at 1s and doubles each time, up to 10 min.
33- if $(curl --fail --silent --show-error --location --retry 10 --connect-timeout 5 --max-time 20 --retry-connrefused https://github.com/dfinity/pocketic/releases/download/${POCKET_IC_VERSION}/pocket-ic-x86_64-${OS}.gz -o pocket-ic.gz); then
52+ if $(curl --fail --silent --show-error --location --retry 10 --connect-timeout 5 --max-time 20 --retry-connrefused "${URL}" -o pocket-ic.gz); then
3453 echo "Successfully downloaded PocketIC server."
3554 else
3655 echo "Failed to download PocketIC server."
You can’t perform that action at this time.
0 commit comments