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

chore: add integrator test CI #3394

Merged
merged 19 commits into from
May 12, 2023
97 changes: 97 additions & 0 deletions .github/workflows/era-tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: era compiler tester

# run the matter labs compiler test to integrate their test cases
# this is intended as a diagnostic / spot check to check that we
# haven't seriously broken the compiler. but, it is not intended as
# a requirement for merging since we may make changes to our IR
# which break the downstream backend (at which point, downstream needs
# to update, which we do not want to be blocked on).

on: [push, pull_request]

concurrency:
# cancel older, in-progress jobs from the same PR, same workflow.
# use run_id if the job is triggered by a push to ensure
# push-triggered jobs to not get canceled.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
era-compiler-tester:
runs-on: ubuntu-latest

steps:
- name: Get latest commit hash
run: |
echo "ERA_HASH=$( curl -u "u:${{ github.token }}" https://api.github.com/repos/matter-labs/era-compiler-tester/git/ref/heads/main | jq .object.sha | tr -d '"' )" >> $GITHUB_ENV
echo "ERA_VYPER_HASH=$( curl -u "u:${{ github.token }}" https://api.github.com/repos/matter-labs/era-compiler-vyper/git/ref/heads/main | jq .object.sha | tr -d '"' )" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v1

- name: Rust setup
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-03

- name: Set up Python ${{ matrix.python-version[0] }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version[0] }}

- name: Get cache
id: cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
**/target
**/target-llvm
**/compiler_tester
**/llvm
**/era-compiler-tester
key: ${{ runner.os }}-${{ env.ERA_HASH }}-${{ env.ERA_VYPER_HASH }}

- name: Initialize repository and install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone --depth 1 https://github.com/matter-labs/era-compiler-tester.git
cd era-compiler-tester
sed -i 's/ssh:\/\/git@/https:\/\//g' .gitmodules
git submodule init
git submodule update
sudo apt install cmake ninja-build clang-13 lld-13 parallel pkg-config lld
cargo install compiler-llvm-builder
zkevm-llvm clone && zkevm-llvm build
cargo build --release

- name: Save cache
uses: actions/cache/save@v3
if: always()
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
**/target
**/target-llvm
**/compiler_tester
**/llvm
**/era-compiler-tester
key: ${{ runner.os }}-${{ env.ERA_HASH }}-${{ env.ERA_VYPER_HASH }}

- name: Install Vyper
run: |
pip install .
mkdir era-compiler-tester/vyper-bin
echo $(which vyper)
cp $(which vyper) era-compiler-tester/vyper-bin/vyper-0.3.8

- name: Run tester
run: |
cd era-compiler-tester
cargo run --release --bin compiler-tester -- -v --path='tests/vyper/' --mode='M*B* 0.3.8'
Loading