Skip to content

Commit

Permalink
Revert "sync with main (#116)" (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi authored Dec 19, 2023
1 parent 029c775 commit 06ac6b4
Show file tree
Hide file tree
Showing 330 changed files with 7,370 additions and 24,694 deletions.
8 changes: 6 additions & 2 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ RED='\033[0;31m'

# Check that the code is formatted in the given directory provided in the first argument
function check_prettier {
cd $1
if ! yarn prettier:check; then
echo "${RED}Commit error! Cannot commit unformatted code!${NC}"
echo "Prettier errors found. Please format the code via ${CYAN}yarn prettier:fix${NC}!"
echo "Prettier errors found in the ${CYAN}$(pwd)${NC} directory."
echo "Please format the code via ${CYAN}cd $1 && yarn prettier:fix${NC}!"
exit 1
fi
cd ..
}

check_prettier
check_prettier "ethereum"
check_prettier "zksync"
8 changes: 6 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ RED='\033[0;31m'

# Checking that the code is linted and formatted in the given directory provided in the first argument
function check_lint {
cd $1
if ! yarn lint:check; then
echo "${RED}Push error! Cannot push unlinted code!${NC}"
echo "Lint errors found. Please lint the code via ${CYAN}yarn lint:fix${NC} and/or fix the errors manually!"
echo "Lint errors found in the ${CYAN}$(pwd)${NC} directory."
echo "Please lint the code via ${CYAN}cd $1 && yarn lint:fix${NC} and/or fix the errors manually!"
exit 1
fi
cd ..
}

check_lint
check_lint "ethereum"
check_lint "zksync"
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Scripts-Related Bug Report
about: Use this template for reporting script-related bugs. For contract-related bugs, see our security policy.
title: ""
title: ''
labels: bug
assignees: ""
assignees: ''
---

### 🐛 Script Bug Report
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Use this template for requesting features
title: ""
title: ''
labels: feat
assignees: ""
assignees: ''
---

### 🌟 Feature Request
Expand Down
275 changes: 275 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
name: CI

on: pull_request

jobs:
lint-l1:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ethereum

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: ethereum/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint:check

lint-l2:
runs-on: ubuntu-latest

defaults:
run:
working-directory: zksync

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: zksync/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint:check

build-l1:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ethereum

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: ethereum/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Build artifacts
run: yarn build

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-${{ github.sha }}
path: |
ethereum/artifacts
ethereum/cache
ethereum/typechain
build-l2:
runs-on: ubuntu-latest

defaults:
run:
working-directory: zksync

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: zksync/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Build artifacts
run: yarn build

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-zk-${{ github.sha }}
path: |
zksync/artifacts-zk
zksync/cache-zk
zksync/typechain
test-hardhat-l1:
needs: [build-l1, lint-l1]
runs-on: ubuntu-latest

defaults:
run:
working-directory: ethereum

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: ethereum/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-${{ github.sha }}
path: |
ethereum/artifacts
ethereum/cache
ethereum/typechain
- name: Run tests
run: yarn test --no-compile

test-foundry-l1:
needs: [build-l1, lint-l1]
runs-on: ubuntu-latest

defaults:
run:
working-directory: ethereum

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: ethereum/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-${{ github.sha }}
path: |
ethereum/artifacts
ethereum/cache
ethereum/typechain
- name: Run tests
run: forge test

test-hardhat-l2:
needs: [build-l2, lint-l2]
runs-on: ubuntu-latest

defaults:
run:
working-directory: zksync

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn
cache-dependency-path: zksync/yarn.lock

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-zk-${{ github.sha }}
path: |
zksync/artifacts-zk
zksync/cache-zk
zksync/typechain
- name: Run Era test node
uses: dutterbutter/era-test-node-action@latest

- name: Run tests
run: yarn hardhat test

check-verifier-generator:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.72.0

- name: Generete Verifier.sol
working-directory: tools
run: cargo run

- name: Compare
run: diff tools/data/Verifier.sol ethereum/contracts/zksync/Verifier.sol
Loading

0 comments on commit 06ac6b4

Please sign in to comment.