diff --git a/.circleci/fetch_geth_parity_solc.sh b/.circleci/fetch_geth_parity_solc.sh index 69e2b6a54..58f3ac366 100755 --- a/.circleci/fetch_geth_parity_solc.sh +++ b/.circleci/fetch_geth_parity_solc.sh @@ -5,7 +5,6 @@ set -x [[ -n ${OS_NAME:?} ]] [[ -n ${GETH_VERSION:?} ]] -[[ -n ${PARITY_VERSION:?} ]] [[ -n ${SOLC_VERSION:?} ]] if [[ -z ${LOCAL_BASE} ]]; then @@ -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 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 97fdf8fdd..c7bd46edf 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -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 @@ -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: @@ -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