Use solc-select for solc installation

pull/943/head
Emilio López 2 years ago
parent baf05c669e
commit 48d90cb2f0
  1. 67
      .github/scripts/install-solc.sh
  2. 18
      .github/workflows/ci.yml

@ -1,20 +1,7 @@
#!/bin/bash
set -eux -o pipefail
# Adapted from https://github.com/commercialhaskell/stack
set -eux
mkdir -p $HOME/.local/bin;
wget() {
if [ -f '/c/msys64/usr/bin/wget.exe' ]; then
cmd="/c/msys64/usr/bin/wget.exe"
else
cmd="wget"
fi
command "$cmd" -q $*
}
pip3 install solc-select --user
travis_retry() {
cmd=$*
@ -23,47 +10,19 @@ travis_retry() {
fetch_solc() {
VER="$1"
FILE="$2"
EXT="$3"
if [ ! -f "$HOME/.local/bin/solc-$VER$EXT" ]; then
rm -Rf "$FILE"
wget "https://github.com/ethereum/solidity/releases/download/v$VER/$FILE"
chmod +x "$FILE"
mv "$FILE" "$HOME/.local/bin/solc-$VER$EXT"
echo "Downloaded solc $VER"
else
echo "Skipped solc $VER, already present"
fi
}
fetch_solc_linux() {
fetch_solc "$1" "solc-static-linux" ""
}
fetch_solc_windows() {
fetch_solc "$1" "solc-windows.exe" ".exe"
solc-select use "$VER" --always-install
}
fetch_all() {
FETCHER="$1"
"$FETCHER" "0.4.25"
"$FETCHER" "0.5.7"
"$FETCHER" "0.6.12"
"$FETCHER" "0.7.5"
fetch_solc "0.4.25"
fetch_solc "0.5.7"
fetch_solc "0.6.12"
fetch_solc "0.7.5"
}
if [ "$HOST_OS" = "Linux" ]; then
if [ "${SOLC_VER:-}" == "" ]; then
travis_retry fetch_all fetch_solc_linux
else
travis_retry fetch_solc_linux "$SOLC_VER"
fi
elif [ "$HOST_OS" = "Windows" ]; then
if [ "${SOLC_VER:-}" == "" ]; then
travis_retry fetch_all fetch_solc_windows
else
travis_retry fetch_solc_windows "$SOLC_VER"
fi
fi
if [ "${SOLC_VER:-}" == "" ]; then
travis_retry fetch_all
else
travis_retry fetch_solc "$SOLC_VER"
fi

@ -182,18 +182,8 @@ jobs:
with:
name: echidna-testsuite-${{ runner.os }}
- name: Test (Linux)
if: runner.os == 'Linux'
run: |
export PATH="${PATH}:$HOME/.local/bin"
cp "$HOME/.local/bin/solc-${{ matrix.solc }}" "$HOME/.local/bin/solc"
chmod +x echidna-testsuite
./echidna-testsuite
- name: Test (Windows)
if: runner.os == 'Windows'
shell: bash
- name: Test
run: |
export PATH="${PATH}:$HOME/.local/bin"
cp "$HOME/.local/bin/solc-${{ matrix.solc }}.exe" "$HOME/.local/bin/solc.exe"
./echidna-testsuite.exe
solc-select use ${{ matrix.solc }}
chmod +x echidna-testsuite*
./echidna-testsuite*

Loading…
Cancel
Save