forked from okx/xlayer-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/v0.2.0 to develop (0xPolygonHermez#2322)
Merge release/0.2.0
- Loading branch information
1 parent
8112f22
commit 517d5cc
Showing
125 changed files
with
8,237 additions
and
838 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,61 @@ | ||
--- | ||
name: JSON schema | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
- update-external-dependencies | ||
- 'release/**' | ||
pull_request: | ||
|
||
jobs: | ||
json-schema: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.19.x ] | ||
goarch: [ "amd64" ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
# https://github.com/actions/checkout#Checkout-pull-request-HEAD-commit-instead-of-merge-commit | ||
# Checkout pull request HEAD commit instead of merge commit | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
env: | ||
GOARCH: ${{ matrix.goarch }} | ||
|
||
- uses: actions/setup-python@v1 | ||
- uses: BSFishy/pip-action@v1 | ||
with: | ||
packages: | | ||
json-schema-for-humans | ||
- name: Check if JSON schema and generated doc is up to date | ||
run: | | ||
EXPECTED_DIFF="" | ||
NOT_UPDATED_MSG="JSON Schema is not up to date, run 'make config-doc-gen' before creating the PR" | ||
echo "Checking if JSON schema is up to date..." | ||
make GENERATE_DOC_PATH=/tmp/ config-doc-gen | ||
for CHECK_FILE in "node-config-schema.json" "node-config-doc.md" "node-config-doc.html" "custom_network-config-schema.json" "custom_network-config-doc.md" "custom_network-config-doc.html"; do | ||
EXPECTED_FILE=tmp/$CHECK_FILE | ||
REAL_FILE=docs/config-file/$CHECK_FILE | ||
echo "checking $CHECK_FILE ...." | ||
diff /tmp/$CHECK_FILE docs/config-file/$CHECK_FILE | ||
if [ $? -ne 0 ]; then | ||
echo " FAILED file $CHECK_FILE!" | ||
exit 1 | ||
fi | ||
echo "checked $CHECK_FILE OK" | ||
done | ||
echo "Everything up to date" | ||
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 |
---|---|---|
|
@@ -16,4 +16,6 @@ | |
.env | ||
out.dat | ||
|
||
cmd/__debug_bin | ||
cmd/__debug_bin | ||
|
||
.venv |
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
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 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/0xPolygonHermez/zkevm-node/config" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
func genJSONSchema(cli *cli.Context) error { | ||
file_config := cli.String(config.FlagDocumentationFileType) | ||
output := cli.String(config.FlagOutputFile) | ||
switch file_config { | ||
case NODE_CONFIGFILE: | ||
{ | ||
generator := config.NewNodeConfigJsonSchemaGenerater() | ||
return generator.GenerateJsonSchemaAndWriteToFile(cli, output) | ||
} | ||
case NETWORK_CONFIGFILE: | ||
{ | ||
generator := config.NewNetworkConfigJsonSchemaGenerater() | ||
return generator.GenerateJsonSchemaAndWriteToFile(cli, output) | ||
} | ||
default: | ||
panic("Not supported this config file: " + file_config) | ||
} | ||
} |
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
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
Oops, something went wrong.