Skip to content

Commit

Permalink
Install geth and solc
Browse files Browse the repository at this point in the history
  • Loading branch information
karlb committed Aug 4, 2022
1 parent 0e118dd commit de2f982
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .circleci/fetch_geth_parity_solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -x

[[ -n ${OS_NAME:?} ]]
[[ -n ${GETH_VERSION:?} ]]
[[ -n ${PARITY_VERSION:?} ]]
[[ -n ${SOLC_VERSION:?} ]]

if [[ -z ${LOCAL_BASE} ]]; then
Expand Down Expand Up @@ -34,25 +33,6 @@ if [[ ! -x ${GETH_PATH} ]]; then
fi
ln -sfn "${GETH_PATH}" "${LOCAL_BASE}"/bin/geth

PARITY_PATH="${LOCAL_BASE}/bin/openethereum-${OS_NAME}-${PARITY_VERSION}"
if [[ ! -x ${PARITY_PATH} ]]; then
mkdir -p ${LOCAL_BASE}/bin
PARITY_URL_VAR="PARITY_URL_${OS_NAME}"
curl -L "${!PARITY_URL_VAR}" > /tmp/openethereum.zip
unzip -p /tmp/openethereum.zip openethereum > "${PARITY_PATH}"
chmod 775 "${PARITY_PATH}"

PARITY_SHA256_VAR="PARITY_SHA256_${OS_NAME}"
if [[ -z ${!PARITY_SHA256_VAR} ]]; then
COMPUTED_SHA256=$(sha256sum "${PARITY_PATH}" | cut '-d ' -f1)

if [[ ${COMPUTED_SHA256} != "${!PARITY_SHA256_VAR}" ]]; then
exit 1;
fi
fi
fi
ln -sfn "${PARITY_PATH}" "${LOCAL_BASE}"/bin/openethereum

# Only deal with solc for Linux since it's only used for testing
if [[ ${OS_NAME} != "LINUX" ]]; then
exit 0
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ on:
pull_request:
branches: [ "*" ]

env:
GETH_URL_LINUX: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.1-c2d2f4ed.tar.gz'
GETH_MD5_LINUX: '5e18a027f9919ed9ba08abd15c169f61'
GETH_URL_MACOS: 'https://gethstore.blob.core.windows.net/builds/geth-darwin-amd64-1.10.1-c2d2f4ed.tar.gz'
GETH_MD5_MACOS: '50270c1205c0a27457d9a8b182670c83'
GETH_VERSION: '1.10.1'
SOLC_URL_LINUX: 'https://github.com/ethereum/solidity/releases/download/v0.6.3/solc-static-linux'
SOLC_VERSION: 'v0.6.3'


jobs:
lint-and-test:
runs-on: ubuntu-latest
Expand All @@ -14,6 +24,19 @@ jobs:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Prepare cache key
run: |
echo ${GETH_VERSION} > /tmp/geth-version
echo ${SOLC_VERSION} > /tmp/solc-version
- uses: actions/cache@v2
with:
path: |
~/.local
key: ${{ runner.os }}-v1-geth-${{ hashFiles('/tmp/geth-version') }}-solc-{{'/tmp/solc-version'}}
- name: Install geth and solc
run: |
export OS_NAME=$(uname -s | sed s/Darwin/macos/ | tr '[:lower:]' '[:upper:]')
.circleci/fetch_geth_parity_solc.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -39,4 +62,5 @@ jobs:
- name: Test
run: |
source ./venv/bin/activate
export PATH=$PATH:$HOME/.local/bin
pytest raiden_common/tests/unit -n 4 -x

0 comments on commit de2f982

Please sign in to comment.