Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support custom solc version #6

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/actions/build-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ inputs:
description: 'Type of ccache key: `static` - rotate each month, or `dynamic` - rotate with each update of `LLVM.lock`.'
required: false
default: 'dynamic'
save-ccache:
description: 'Whether to save ccache after the build.'
required: false
default: 'false'


runs:
using: "composite"
steps:
Expand Down Expand Up @@ -85,6 +91,16 @@ runs:
shell: 'bash'
run: apt update

- name: Define ccache save key
id: ccache-save
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
run: |
if [ '${{ inputs.save-ccache }}' = 'true' ]; then
echo "save=true" | tee -a "${GITHUB_OUTPUT}"
else
echo "save=${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') }}" | tee -a "${GITHUB_OUTPUT}"
fi

- name: Set up compiler cache
uses: hendrikmuhs/[email protected]
env:
Expand All @@ -97,7 +113,7 @@ runs:
append-timestamp: false
max-size: "2G"
verbose: 2
save: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') }}
save: ${{ steps.ccache-save.outputs.save }}

# CCACHE_BASEDIR, CCACHE_NOHASHDIR, and CCACHE_COMPILERCHECK
# are allowing to cache compiler output across different
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ on:
compiler_tester_reference_branch:
type: string
description: "compiler-tester branch to use as a benchmark reference"
required: true
required: false
default: "main"
compiler_tester_candidate_branch:
type: string
description: "compiler-tester branch to use as a benchmark candidate"
required: true
required: false
default: "main"
compiler_llvm_reference_branch:
type: string
description: "compiler-llvm branch to use as a benchmark reference"
required: true
required: false
default: "main"
compiler_llvm_candidate_branch:
type: string
description: "compiler-llvm branch to use as a benchmark candidate"
required: true
required: false
default: "main"
compiler_llvm_benchmark_mode:
type: string
Expand Down Expand Up @@ -58,6 +58,11 @@ on:
required: false
default: ''
description: 'run id of custom zksync solc artifact to download.'
custom-solc-version:
type: string
required: false
default: ''
description: 'custom solc version to use for benchmarks'

jobs:
benchmarks:
Expand Down Expand Up @@ -122,19 +127,23 @@ jobs:
--target-dir './target-zkvyper/'

- name: Download custom solc
if: inputs.custom-solc-run-id != '' && matrix.type == 'candidate'
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != ''
uses: actions/download-artifact@v4
with:
path: ./solc-bin/
pattern: solc*
path: ./solc-custom-bin/
run-id: ${{ inputs.custom-solc-run-id }}
merge-multiple: true

- name: Prepare custom solc
if: inputs.custom-solc-run-id != '' && matrix.type == 'candidate'
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != ''
run: |
chmod a+x ./solc-bin/solc*
mkdir -p ./solc-bin
chmod a+x "./solc-custom-bin/solc-${{ inputs.custom-solc-version}}-${{ matrix.type }}"
mv "./solc-custom-bin/solc-${{ inputs.custom-solc-version}}-${{ matrix.type }}" \
"./solc-bin/solc-${{ inputs.custom-solc-version}}"
echo "Testing with custom solc from run ${{ inputs.custom-solc-run-id }}"
echo $(./solc-bin/solc* --version)
echo $(./solc-bin/solc-${{ inputs.custom-solc-version}} --version)

- name: Run benchmarks
run: |
Expand All @@ -146,6 +155,7 @@ jobs:
--benchmark=${{ matrix.type }}.json

- uses: actions/upload-artifact@v4
if: always()
with:
name: compiler-llvm-${{ matrix.type }}-benchmark
path: ${{ matrix.type }}.json
Expand All @@ -158,6 +168,7 @@ jobs:
container:
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
needs: benchmarks
if: always()
steps:
- name: Checking out the compiler-tester repository
uses: actions/checkout@v4
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ on:
required: false
default: ''
description: 'run id of custom zksync solc artifact to download.'
custom-solc-version:
type: string
required: false
default: ''
description: 'custom solc version to use for integration tests'
ccache-key-type:
type: string
required: false
default: 'dynamic'
description: 'Type of ccache key: `static` - rotate each month, or `dynamic` - rotate with each update of `LLVM.lock`.'
save-ccache:
type: string
required: false
default: 'false'
description: 'Whether to save ccache after the build.'
compiler-tester-repo:
type: string
required: false
Expand Down Expand Up @@ -93,19 +103,23 @@ jobs:
--target-dir './target-zkvyper/'

- name: Download custom solc
if: inputs.custom-solc-run-id != ''
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != ''
uses: actions/download-artifact@v4
with:
path: ./solc-bin/
pattern: solc*
path: ./solc-custom-bin/
run-id: ${{ inputs.custom-solc-run-id }}
merge-multiple: true

- name: Prepare custom solc
if: inputs.custom-solc-run-id != ''
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != ''
run: |
chmod a+x ./solc-bin/solc*
mkdir -p ./solc-bin
chmod a+x "./solc-custom-bin/solc-${{ inputs.custom-solc-version}}-candidate"
mv "./solc-custom-bin/solc-${{ inputs.custom-solc-version}}-candidate" \
"./solc-bin/solc-${{ inputs.custom-solc-version}}"
echo "Testing with custom solc from run ${{ inputs.custom-solc-run-id }}"
echo $(./solc-bin/solc* --version)
echo $(./solc-bin/solc-${{ inputs.custom-solc-version}} --version)

- name: Run integration tests
run: |
Expand Down