-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add multiplatform integraion tests support
- Loading branch information
1 parent
61387dc
commit a9d6892
Showing
2 changed files
with
195 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: 'Run integration tests' | ||
description: 'Runs integration tests.' | ||
inputs: | ||
compiler-tester-ref: | ||
required: false | ||
description: 'Compiler tester revision to use.' | ||
llvm-ref: | ||
required: false | ||
description: 'LLVM revision to use.' | ||
path: | ||
required: false | ||
default: '' | ||
description: 'Path filter for integration tests execution. For example: `tests/solidity/`.' | ||
extra-args: | ||
required: false | ||
default: '' | ||
description: 'Extra arguments for era-compiler-tester.' | ||
custom-solc-run-id: | ||
required: false | ||
default: '' | ||
description: 'run id of custom zksync solc artifact to download.' | ||
custom-solc-version: | ||
required: false | ||
default: '' | ||
description: 'custom solc version to use for integration tests' | ||
ccache-key-type: | ||
required: false | ||
default: 'dynamic' | ||
description: 'Type of ccache key: `static` - rotate each month, or `dynamic` - rotate with each update of `LLVM.lock`.' | ||
save-ccache: | ||
required: false | ||
default: 'false' | ||
description: 'Whether to save ccache after the build.' | ||
compiler-tester-repo: | ||
required: false | ||
default: 'matter-labs/era-compiler-tester' | ||
description: 'Compiler tester repository to use. Required for forks testing.' | ||
compiler-llvm-repo: | ||
required: false | ||
default: 'matter-labs/era-compiler-llvm' | ||
description: 'Compiler LLVM repository to use. Required for forks testing.' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Checkout compiler-tester | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.compiler-tester-repo }} | ||
ref: ${{ inputs.compiler-tester-ref || '' }} | ||
submodules: recursive | ||
|
||
- name: Checkout LLVM | ||
if: inputs.llvm-ref != '' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.compiler-llvm-repo }} | ||
ref: ${{ inputs.llvm-ref }} | ||
path: llvm | ||
|
||
# An issue prevents to correctly use the same version of composite actions from `workflow_call` | ||
# https://github.com/actions/toolkit/issues/1264 | ||
# for now, it will always be taken from the latest main | ||
- name: Build LLVM | ||
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@main | ||
with: | ||
extra-args: "\\-DLLVM_ENABLE_WERROR=On \\-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" | ||
enable-tests: true | ||
enable-assertions: true | ||
clone-llvm: ${{ inputs.llvm-ref == '' && 'true' || 'false' }} | ||
ccache-key-type: ${{ inputs.ccache-key-type }} | ||
|
||
- name: Build compiler-tester | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: cargo build --verbose --release --bin 'compiler-tester' | ||
|
||
- name: Build zksolc | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: | | ||
[ -z ${CARGO_HOME} ] && CARGO_HOME=${HOME}/.cargo | ||
cargo build --verbose --release \ | ||
--manifest-path ${CARGO_HOME}/git/checkouts/era-compiler-solidity-*/*/Cargo.toml \ | ||
--target-dir './target-zksolc/' | ||
- name: Build zkvyper | ||
if: ${{ ! (runner.os == 'Linux' && runner.arch == 'ARM64') }} | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: | | ||
[ -z ${CARGO_HOME} ] && CARGO_HOME=${HOME}/.cargo | ||
cargo build --verbose --release \ | ||
--manifest-path ${CARGO_HOME}/git/checkouts/era-compiler-vyper-*/*/Cargo.toml \ | ||
--target-dir './target-zkvyper/' | ||
- name: Download custom solc | ||
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != '' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: solc* | ||
path: ./solc-custom-bin/ | ||
run-id: ${{ inputs.custom-solc-run-id }} | ||
merge-multiple: true | ||
|
||
- name: Prepare custom solc | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
if: inputs.custom-solc-run-id != '' && inputs.custom-solc-version != '' | ||
run: | | ||
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-${{ inputs.custom-solc-version}} --version) | ||
- name: Run integration tests | ||
shell: ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }} | ||
run: | | ||
set -x | ||
./target/release/compiler-tester \ | ||
--zksolc './target-zksolc/release/zksolc' \ | ||
--zkvyper './target-zkvyper/release/zkvyper' \ | ||
--path '${{ inputs.path }}' ${{ inputs.extra-args }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters