Skip to content

Commit 8cd8216

Browse files
committed
CI: Download solc, cache it and run solc-runner tests
1 parent 8ef402a commit 8cd8216

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212
CARGO_TERM_COLOR: always
1313
CARGO_INCREMENTAL: 0
1414
RUST_BACKTRACE: full
15+
SOLC_VERSION: v0.8.30
1516

1617
jobs:
1718
lint:
@@ -52,11 +53,33 @@ jobs:
5253
uses: dtolnay/rust-toolchain@stable
5354
with:
5455
toolchain: stable
56+
- name: Cache solc
57+
id: solc-cache
58+
uses: actions/cache@v4
59+
with:
60+
path: ${{ runner.temp }}/solc-${{ env.SOLC_VERSION }}
61+
key: solc-${{ runner.os }}-${{ env.SOLC_VERSION }}
62+
- name: Download solc
63+
if: steps.solc-cache.outputs.cache-hit != 'true'
64+
run: |
65+
set -euo pipefail
66+
if [ "${{ runner.os }}" = "Linux" ]; then
67+
url="https://github.com/ethereum/solidity/releases/download/${SOLC_VERSION}/solc-static-linux"
68+
elif [ "${{ runner.os }}" = "macOS" ]; then
69+
url="https://github.com/ethereum/solidity/releases/download/${SOLC_VERSION}/solc-macos"
70+
else
71+
echo "Unsupported OS: ${{ runner.os }}"
72+
exit 1
73+
fi
74+
curl -Ls "$url" -o "$RUNNER_TEMP/solc-${SOLC_VERSION}"
75+
chmod +x "$RUNNER_TEMP/solc-${SOLC_VERSION}"
5576
- name: Cache Dependencies
5677
uses: Swatinem/rust-cache@v2
5778
- name: Build
5879
run: cargo test --workspace --all-features --no-run --locked --exclude fe-language-server --exclude fe-bench
5980
- name: Run tests
81+
env:
82+
FE_SOLC_PATH: ${{ runner.temp }}/solc-${{ env.SOLC_VERSION }}
6083
run: cargo test --workspace --all-features --verbose --exclude fe-language-server --exclude fe-bench
6184

6285
wasm-wasi-check:

0 commit comments

Comments
 (0)