Skip to content

Commit

Permalink
feat: support --target parameter for compiler tester
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed Jul 8, 2024
1 parent 61387dc commit 6a1c6ca
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: "Enable assertions."
required: false
default: 'true'
sanitizer:
description: 'A sanitizer to build LLVM with. Possible values are Address, Memory, MemoryWithOrigins, Undefined, Thread, DataFlow, and Address;Undefined'
required: false
default: ''
extra-args:
description: 'Extra CMake arguments to compile LLVM.'
required: false
Expand Down Expand Up @@ -132,5 +136,6 @@ runs:
[ "${{ inputs.enable-tests }}" = "true" ] && ENABLE_TESTS="--enable-tests"
[ "${{ inputs.enable-assertions }}" = "true" ] && ENABLE_ASSERTIONS="--enable-assertions"
[ "${{ inputs.extra-args }}" != "" ] && EXTRA_ARGS="--extra-args ${{ inputs.extra-args }}"
[ "${{ inputs.sanitizer }}" != "" ] && SANITIZER="--sanitizer ${{ inputs.sanitizer }}"
zksync-llvm build --target-env ${{ inputs.target-env }} \
--use-ccache ${{ inputs.builder-extra-args }} ${DEBUG_ARG} ${ENABLE_TESTS} ${ENABLE_ASSERTIONS} ${EXTRA_ARGS}
--use-ccache ${{ inputs.builder-extra-args }} ${DEBUG_ARG} ${ENABLE_TESTS} ${ENABLE_ASSERTIONS} ${SANITIZER} ${EXTRA_ARGS}
14 changes: 12 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,20 @@ on:
required: false
default: ''
description: 'custom solc version to use for benchmarks'
target-machine:
type: string
required: false
default: ''
description: 'Target machine passed via `--target` for era-compiler-tester. Available arguments: `EraVM`, `EVM`, `EVMInterpreter`. Use `default` or `` to skip `--target` parameter.'

jobs:

benchmarks:
strategy:
fail-fast: false
matrix:
type: ["reference", "candidate"]
name: ${{ matrix.type }}
name: ${{ inputs.target-machine}} ${{ matrix.type }}
runs-on: matterlabs-ci-runner
container:
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
Expand Down Expand Up @@ -146,8 +152,12 @@ jobs:
echo $(./solc-bin/solc-${{ inputs.custom-solc-version}} --version)
- name: Run benchmarks
shell: bash -ex {0}
run: |
./target/release/compiler-tester \
if [[ -n "${{ inputs.target-machine }}" && "${{ inputs.target-machine }}" != "default" ]]; then
TARGET="--target ${{ inputs.target-machine }}"
fi
echo ./target/release/compiler-tester ${TARGET} \
--zksolc './target-zksolc/release/zksolc' \
--zkvyper './target-zkvyper/release/zkvyper' \
--path=${{ inputs.compiler_llvm_benchmark_path || '' }} \
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
required: false
default: ''
description: 'Path filter for integration tests execution. For example: `tests/solidity/`.'
target-machine:
type: string
required: false
default: ''
description: 'Target machine passed via `--target` for era-compiler-tester. Available arguments: `EraVM`, `EVM`, `EVMInterpreter`. Use `default` or `` to skip `--target` parameter.'
extra-args:
type: string
required: false
Expand Down Expand Up @@ -53,12 +58,14 @@ on:
description: 'Compiler LLVM repository to use. Required for forks testing.'

jobs:
run-integration-tests:

integration-tests:
runs-on: ci-runner-compiler
timeout-minutes: 720
container:
image: matterlabs/llvm_runner:ubuntu22-llvm17-latest
options: -m 110g
name: Integration Tests ${{ inputs.target-machine || 'default' }}
steps:

- name: Checkout compiler-tester
Expand Down Expand Up @@ -122,9 +129,12 @@ jobs:
echo $(./solc-bin/solc-${{ inputs.custom-solc-version}} --version)
- name: Run integration tests
shell: bash -ex {0}
run: |
set -x
./target/release/compiler-tester \
if [[ -n "${{ inputs.target-machine }}" && "${{ inputs.target-machine }}" != "default" ]]; then
TARGET="--target ${{ inputs.target-machine }}"
fi
echo ./target/release/compiler-tester ${TARGET} \
--zksolc './target-zksolc/release/zksolc' \
--zkvyper './target-zkvyper/release/zkvyper' \
--path '${{ inputs.path }}' ${{ inputs.extra-args }}
Expand All @@ -133,6 +143,7 @@ jobs:
uses: 8398a7/action-slack@v3
if: (failure() || success()) && (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork)
with:
job_name: Integration Tests ${{ inputs.target-machine || 'default' }}
status: ${{ job.status }}
fields: repo,commit,author,action,eventName,ref,workflow,job,took,pullRequest
env:
Expand Down

0 comments on commit 6a1c6ca

Please sign in to comment.