-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from bnb-chain/develop
release: framework refactor for zkbas
- Loading branch information
Showing
649 changed files
with
24,957 additions
and
43,323 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
# ./bin | ||
build |
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,52 @@ | ||
name: Build Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
unit-test: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Test Build | ||
run: | | ||
export GOPATH=$(go env GOPATH) | ||
go install github.com/zeromicro/go-zero/tools/[email protected] | ||
make build | ||
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,38 @@ | ||
name: Deploy zkbas on qa1 | ||
|
||
on: | ||
push: | ||
branches: | ||
- qa1 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Deploy new zkbas on qa1 | ||
run: | | ||
echo 'fetch zkbas repo' | ||
export BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') | ||
cd ~ | ||
rm -rf ./zkbas | ||
git clone --branch qa1 https://github.com/bnb-chain/zkbas.git | ||
cd ./zkbas | ||
sudo scp -r ./deploy-qa.sh "qa1:/tmp/" | ||
sudo ssh qa1 "sudo bash -x /tmp/deploy-qa.sh qa1;exit" | ||
echo "end deploy on qa1" | ||
- name: Notification via slack | ||
run: | | ||
export SLACK_WEBHOOK_URL=`sudo cat /home/ec2-user/actions-runner/slack-config.json | jq -r '.slack'` | ||
export JOB_STATUS=${{ job.status }} | ||
sudo scp -r qa1:/root/zkbas-deploy/zkbas-contract/info/addresses.json ~/addresses.json | ||
export ZkBas=`sudo cat ~/addresses.json | jq -r '.zkbasProxy'` | ||
export AssetGov=`sudo cat ~/addresses.json | jq -r '.assetGovernance'` | ||
curl -X POST $SLACK_WEBHOOK_URL --header 'Content-Type: application/json' \ | ||
--data-raw '{ "author": "@'$GITHUB_ACTOR'", "status": "'$JOB_STATUS'", "ref": "'$GITHUB_REF'", "event": "'$GITHUB_EVENT_NAME'", "url": "'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'/commit/'$GITHUB_SHA'/checks", "ZkbasContract": "'$ZkBas'", "AssetGovContract": "'$AssetGov'" }' | ||
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,38 @@ | ||
name: Deploy zkbas on qa2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- qa2 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Deploy new zkbas on qa2 | ||
run: | | ||
echo 'fetch zkbas repo' | ||
export BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') | ||
cd ~ | ||
rm -rf ./zkbas | ||
git clone --branch qa2 https://github.com/bnb-chain/zkbas.git | ||
cd ./zkbas | ||
sudo scp -r ./deploy-qa.sh "qa2:/tmp/" | ||
sudo ssh qa2 "sudo bash -x /tmp/deploy-qa.sh qa2;exit" | ||
echo "end deploy on qa2" | ||
- name: Notification via slack | ||
run: | | ||
export SLACK_WEBHOOK_URL=`sudo cat /home/ec2-user/actions-runner/slack-config.json | jq -r '.slack'` | ||
export JOB_STATUS=${{ job.status }} | ||
sudo scp -r qa2:/root/zkbas-deploy/zkbas-contract/info/addresses.json ~/addresses.json | ||
export ZkBas=`sudo cat ~/addresses.json | jq -r '.zkbasProxy'` | ||
export AssetGov=`sudo cat ~/addresses.json | jq -r '.assetGovernance'` | ||
curl -X POST $SLACK_WEBHOOK_URL --header 'Content-Type: application/json' \ | ||
--data-raw '{ "author": "@'$GITHUB_ACTOR'", "status": "'$JOB_STATUS'", "ref": "'$GITHUB_REF'", "event": "'$GITHUB_EVENT_NAME'", "url": "'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'/commit/'$GITHUB_SHA'/checks", "ZkbasContract": "'$ZkBas'", "AssetGovContract": "'$AssetGov'" }' | ||
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,38 @@ | ||
name: Deploy zkbas on qa3 | ||
|
||
on: | ||
push: | ||
branches: | ||
- qa3 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: self-hosted | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Deploy new zkbas on qa3 | ||
run: | | ||
echo 'fetch zkbas repo' | ||
export BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }') | ||
cd ~ | ||
rm -rf ./zkbas | ||
git clone --branch qa3 https://github.com/bnb-chain/zkbas.git | ||
cd ./zkbas | ||
sudo scp -r ./deploy-qa.sh "qa3:/tmp/" | ||
sudo ssh qa3 "sudo bash -x /tmp/deploy-qa.sh qa3;exit" | ||
echo "end deploy on qa3" | ||
- name: Notification via slack | ||
run: | | ||
export SLACK_WEBHOOK_URL=`sudo cat /home/ec2-user/actions-runner/slack-config.json | jq -r '.slack'` | ||
export JOB_STATUS=${{ job.status }} | ||
sudo scp -r qa3:/root/zkbas-deploy/zkbas-contract/info/addresses.json ~/addresses.json | ||
export ZkBas=`sudo cat ~/addresses.json | jq -r '.zkbasProxy'` | ||
export AssetGov=`sudo cat ~/addresses.json | jq -r '.assetGovernance'` | ||
curl -X POST $SLACK_WEBHOOK_URL --header 'Content-Type: application/json' \ | ||
--data-raw '{ "author": "@'$GITHUB_ACTOR'", "status": "'$JOB_STATUS'", "ref": "'$GITHUB_REF'", "event": "'$GITHUB_EVENT_NAME'", "url": "'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'/commit/'$GITHUB_SHA'/checks", "ZkbasContract": "'$ZkBas'", "AssetGovContract": "'$AssetGov'" }' | ||
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
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,25 @@ | ||
name: Issue Trigger | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, closed] | ||
issue_comment: | ||
types: [created, edited, deleted] | ||
|
||
jobs: | ||
trigger: | ||
runs-on: self-hosted | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: update-integration-keyfile | ||
if: contains(github.event.pull_request.body, '/update-integration-keyfile') # check the comment if it contains the keywords | ||
run: | | ||
cd /server | ||
sudo rm -rf ./zkbas | ||
sudo git clone --branch develop https://github.com/bnb-chain/zkbas.git | ||
cd ./zkbas | ||
sudo bash ./deployment/tool/tool.sh prepare new | ||
sudo rm -rf /server/test.keyfile | ||
sudo cp -r ./deployment/.zkbas /server/test.keyfile |
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,52 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Lint | ||
run: | | ||
export GOPATH=$(go env GOPATH) | ||
go install github.com/zeromicro/go-zero/tools/[email protected] | ||
make api-server | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0 | ||
golangci-lint run ./... |
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,53 @@ | ||
name: Unit Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
unit-test: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-18.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Uint Test | ||
env: | ||
ANDROID_HOME: "" # Skip android test | ||
run: | | ||
export GOPATH=$(go env GOPATH) | ||
go install github.com/zeromicro/go-zero/tools/[email protected] | ||
make api-server | ||
make test |
Oops, something went wrong.