Skip to content

Commit

Permalink
add taiko-client at d2e9667
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx committed May 8, 2024
1 parent 6ee06f1 commit 91ce070
Show file tree
Hide file tree
Showing 183 changed files with 45,287 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/taiko-client/.github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Push docker image to GAR"

on:
push:
branches: [main]
tags:
- "v*"

jobs:
push-docker-image:
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to GAR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
us-docker.pkg.dev/evmchain/images/taiko-client
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 14 additions & 0 deletions packages/taiko-client/.github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Lint PR"

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions packages/taiko-client/.github/workflows/openai-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on: [pull_request]

jobs:
add_pr_comment:
permissions: write-all
runs-on: ubuntu-latest
name: OpenAI PR Comment
if: "contains(github.event.pull_request.labels.*.name, 'option.review-by-ai')"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- id: patch
run: |
patch_output=$(curl --silent --request GET \
--url https://api.github.com/repos/$PATCH_REPO/pulls/$PATCH_PR \
--header "Accept: application/vnd.github.v3.patch" \
--header "Authorization: Bearer $PATCH_GITHUB_TOKEN")
echo $patch_output
echo "GIT_PATCH_OUTPUT=$(echo $patch_output)" >> $GITHUB_ENV
env:
PATCH_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PATCH_PR: ${{ github.event.pull_request.number }}
PATCH_REPO: ${{ github.repository }}
- id: review
uses: taikoxyz/openai-review-action@main
with:
GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
GIT_PATCH_OUTPUT: ${{ env.GIT_PATCH_OUTPUT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORG_KEY: ${{ secrets.OPENAI_ORG_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
REPOSITORY_NAME: ${{ github.repository }}
12 changes: 12 additions & 0 deletions packages/taiko-client/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
command: manifest
61 changes: 61 additions & 0 deletions packages/taiko-client/.github/workflows/swagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Swagger

on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Swagger autogen docs
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
cache: true

- name: install swag cli
run: go install github.com/swaggo/swag/cmd/swag@latest

- name: swag init
run: ./scripts/gen_swagger_json.sh

deploy:
if: ${{ always() }}
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: github pages deploy swagger docs
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: '.'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
97 changes: 97 additions & 0 deletions packages/taiko-client/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: "CI"

on:
push:
branches: [main]
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: taikoxyz/taiko-client

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
cache: true

- name: Lint
run: make lint

integration_tests:
name: Integration tests
runs-on: ubuntu-latest
env:
CLIENT_DIR: taiko-client
TAIKO_MONO_DIR: taiko-mono

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
repository: taikoxyz/taiko-client
path: ${{ env.CLIENT_DIR }}

- uses: actions/checkout@v3
with:
repository: taikoxyz/taiko-mono
path: ${{ env.TAIKO_MONO_DIR }}

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

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
cache: true
cache-dependency-path: ${{ env.CLIENT_DIR }}/go.sum

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8.4.0
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install protocol dependencies
working-directory: ${{ env.TAIKO_MONO_DIR }}
run: cd ./packages/protocol && pnpm install

- name: Test
working-directory: ${{ env.CLIENT_DIR }}
run: |
TAIKO_MONO_DIR=${GITHUB_WORKSPACE}/${TAIKO_MONO_DIR} make test
- name: Codecov.io
uses: codecov/codecov-action@v3
with:
files: ${{ env.CLIENT_DIR }}/coverage.out
29 changes: 29 additions & 0 deletions packages/taiko-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.env
bin
coverage.out
prover/dbPath
dbdata

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Editors
.vscode

# Testing
integration_test/nodes/deployments/mainnet.json
.env

\.idea/
91 changes: 91 additions & 0 deletions packages/taiko-client/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This file configures github.com/golangci/golangci-lint.

run:
timeout: 20m
tests: true
skip-dirs-use-default: true
skip-files:
- bindings/gen_taiko_l1.go
- bindings/gen_taiko_l2.go

issues:
# List of regexps of issue texts to exclude.
#
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`.
# To list all excluded by default patterns execute `golangci-lint run --help`
#
# Default: https://golangci-lint.run/usage/false-positives/#default-exclusions
exclude:
- abcdef

linters:
disable-all: true
enable:
- bidichk
- bodyclose
- durationcheck
- exportloopref
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- goconst
- goimports
- gosimple
- govet
- gosec
- gofmt
- ineffassign
- importas
- lll
- makezero
- misspell
- misspell
- megacheck
- revive
- staticcheck
- sqlclosecheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unused
- whitespace

linters-settings:
gofmt:
simplify: true
goconst:
min-len: 3
min-occurrences: 6
goimports:
local-prefixes: github.com/taikoxyz/taiko-client

severity:
# Set the default severity for issues.
#
# If severity rules are defined and the issues do not match or no severity is provided to the rule
# this will be the default severity applied.
# Severities should match the supported severity names of the selected out format.
# - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity
# - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel
# - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
# - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance
#
# Default: ""
default-severity: error
# If set to true `severity-rules` regular expressions become case-sensitive.
# Default: false
case-sensitive: true
# When a list of severity rules are provided, severity information will be added to lint issues.
# Severity rules have the same filtering capability as exclude rules
# except you are allowed to specify one matcher per severity rule.
# Only affects out formats that support setting severity information.
#
# Default: []
rules:
- linters:
- dupl
severity: info
Loading

0 comments on commit 91ce070

Please sign in to comment.