Skip to content

Commit 85d74c2

Browse files
chore: revamp CI v0.6.1 (#572)
1 parent 14c99de commit 85d74c2

17 files changed

+450
-684
lines changed

.github/actions/solc-build/action.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: 'Build'
2+
description: 'Builds solc executable.'
3+
inputs:
4+
release-suffix:
5+
description: 'Release suffix.'
6+
required: false
7+
default: ''
8+
zksync-version:
9+
description: 'Release version.'
10+
required: true
11+
solc-version:
12+
description: 'Solidity version.'
13+
required: true
14+
build-type:
15+
description: 'Build type: candidate or reference'
16+
required: false
17+
default: 'candidate'
18+
extra-args:
19+
description: 'Extra arguments for cmake.'
20+
required: false
21+
default: ''
22+
runs:
23+
using: "composite"
24+
steps:
25+
26+
- name: Install Boost (MacOS ARM64)
27+
if: runner.os == 'macOS'
28+
shell: bash
29+
env:
30+
BOOST_DOWNLOAD_URL: "https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source"
31+
BOOST_FILENAME: "boost_1_71_0"
32+
run: |
33+
curl -L -o ${BOOST_FILENAME}.tar.gz "${BOOST_DOWNLOAD_URL}/${BOOST_FILENAME}.tar.gz"
34+
tar xzf "${BOOST_FILENAME}.tar.gz" && cd ${BOOST_FILENAME}
35+
if [ ${RUNNER_ARCH} = ARM64 ]; then
36+
./bootstrap.sh --prefix=${PWD}/boost
37+
else
38+
./bootstrap.sh --prefix=/usr/local --with-python-version=2.7
39+
fi
40+
./b2 link=static runtime-link=static -j$(sysctl -n hw.ncpu)
41+
./b2 install -j$(sysctl -n hw.ncpu)
42+
43+
- name: Build solc
44+
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
45+
env:
46+
CXXFLAGS: "-Wno-narrowing"
47+
CMAKE_CXX_FLAGS: "-DJSON_USE_INT64_DOUBLE_CONVERSION"
48+
run: |
49+
mkdir -p ./build
50+
cd ./build
51+
[ ${RUNNER_OS} = macOS ] && PARALLEL=$(sysctl -n hw.ncpu) || PARALLEL=$(nproc)
52+
[ ${RUNNER_OS} = Linux ] && COMPILER_FLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
53+
cmake .. \
54+
-DCMAKE_BUILD_TYPE="Release" ${COMPILER_FLAGS} \
55+
-DSOL_VERSION_ZKSYNC="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \
56+
-DSOLC_VERSION_ZKEVM="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \
57+
-DSOL_VERSION_ZKEVM="${{ inputs.solc-version }}-${{ inputs.zksync-version }}" \
58+
-DUSE_Z3=OFF \
59+
-DUSE_CVC4=OFF \
60+
-DTESTS=0 \
61+
-DBoost_NO_BOOST_CMAKE=TRUE \
62+
-DSOLC_LINK_STATIC=1 \
63+
-DSTATIC_LINKING=1 \
64+
-DPEDANTIC=OFF ${{ inputs.extra-args}}
65+
if [[ ${{ inputs.solc-version}} == "0.4"* ]]; then
66+
cmake --build . --config Release --parallel ${PARALLEL} --target jsoncpp-project
67+
cmake --build . --config Release --parallel ${PARALLEL} --target range-v3-project
68+
fi
69+
cmake --build . --config Release --parallel ${PARALLEL} --target solc
70+
[ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe"
71+
cp ./solc/solc${WIN_SUFFIX} ./solc/solc-${{ inputs.solc-version }}-${{ inputs.build-type }}${WIN_SUFFIX}
72+
73+
- name: Upload binary for testing
74+
if: inputs.release-suffix == ''
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: solc-${{ inputs.solc-version }}-${{ inputs.build-type }}
78+
path: ./build/solc/solc-${{ inputs.solc-version }}-${{ inputs.build-type }}
79+
80+
- name: Prepare binary
81+
if: inputs.release-suffix != ''
82+
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
83+
run: |
84+
[ "$RUNNER_OS" = "Windows" ] && WIN_SUFFIX=".exe"
85+
SOLC_BIN="./build/solc/solc${WIN_SUFFIX}"
86+
mkdir -p ./releases/${{ inputs.release-suffix }}
87+
strip "${SOLC_BIN}"
88+
${SOLC_BIN} --version
89+
mv ${SOLC_BIN} ./releases/${{ inputs.release-suffix }}/solc-${{ inputs.release-suffix }}-${{ inputs.solc-version}}-${{ inputs.zksync-version }}${WIN_SUFFIX}
90+
91+
- name: Upload binary for release
92+
if: inputs.release-suffix != ''
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: release-${{ inputs.release-suffix }}
96+
path: releases

.github/workflows/benchmarks.yml

-207
This file was deleted.

0 commit comments

Comments
 (0)