-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
209 additions
and
0 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,31 @@ | ||
name: Call the CLI testing | ||
on: pull_request | ||
|
||
|
||
jobs: | ||
cli_test_linux_amd64: | ||
name: CLI tests on linux | ||
uses: ./.github/workflows/test-cli.yml | ||
permissions: | ||
contents: read | ||
with: | ||
name: build_linux_amd64 | ||
runner: matterlabs-ci-runner | ||
|
||
cli_test_windows: | ||
name: CLI tests on Windows | ||
uses: ./.github/workflows/test-cli.yml | ||
permissions: | ||
contents: read | ||
with: | ||
name: build_windows_amd64 | ||
runner: windows-2022-github-hosted-16core | ||
|
||
cli_test_macos_amd64: | ||
name: CLI tests on macOS | ||
uses: ./.github/workflows/test-cli.yml | ||
permissions: | ||
contents: read | ||
with: | ||
name: build_macos_amd64 | ||
runner: macos-12-large |
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: Test CLI | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
default: 'build_linux_amd64' | ||
required: true | ||
runner: | ||
type: string | ||
default: 'matterlabs-ci-runner' | ||
required: true | ||
|
||
|
||
jobs: | ||
preparation_and_running_tests: | ||
runs-on: ${{inputs.runner}} | ||
permissions: | ||
contents: read | ||
strategy: | ||
matrix: | ||
node-version: ['lts/*'] # or 18.17.1 | ||
tags: [ | ||
"default" | ||
] | ||
|
||
|
||
name: '${{ matrix.tags }}' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: | | ||
yes | npx zksync-cli | ||
- if: runner.os == 'Windows' | ||
name: Run tests | ||
run: | | ||
./src/tests/test_zksync_cli.sh | ||
shell: bash | ||
|
||
- if: runner.os == 'Linux' || runner.os == 'macOS' | ||
name: Run tests | ||
run: | | ||
./src/tests/test_zksync_cli.sh |
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,126 @@ | ||
#!/bin/bash | ||
|
||
declare -i RESULT_COMMON=0 | ||
|
||
verify_result () { | ||
RESULT_COMMON+=$? | ||
RESULT=$? | ||
if [ $RESULT -eq 0 ]; then | ||
echo success | ||
else | ||
echo failed | ||
fi | ||
} | ||
|
||
|
||
#BASIC | ||
echo "----- BASIC -----" | ||
echo ">>> Basic command like zksync-cli" | ||
|
||
npx zksync-cli | ||
verify_result | ||
|
||
|
||
echo "" | ||
echo ">>> zksync-cli -V" | ||
|
||
npx zksync-cli -V | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli -h" | ||
|
||
npx zksync-cli -h | ||
verify_result | ||
|
||
|
||
#DEV PART | ||
echo "" | ||
echo "----- DEV PART -----" | ||
echo ">>> zksync-cli dev" | ||
|
||
npx zksync-cli dev | ||
verify_result | ||
|
||
|
||
echo "" | ||
echo ">>> zksync-cli dev config" | ||
|
||
yes | npx zksync-cli dev config | ||
verify_result | ||
|
||
|
||
############# | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev start" | ||
|
||
npx zksync-cli dev start | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev stop" | ||
|
||
npx zksync-cli dev stop | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev restart" | ||
|
||
npx zksync-cli dev restart | ||
verify_result | ||
|
||
########## | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev logs" | ||
|
||
npx zksync-cli dev logs | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev clean" | ||
|
||
npx zksync-cli dev clean | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev install [email protected]" | ||
|
||
npx zksync-cli dev install [email protected] | ||
verify_result | ||
|
||
########## | ||
|
||
|
||
echo "" | ||
echo ">>> zksync-cli dev update zksync-web3" | ||
|
||
npx zksync-cli dev update zksync-web3 | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev uninstall zksync-web3" | ||
|
||
npx zksync-cli dev uninstall zksync-web3 | ||
verify_result | ||
|
||
echo "" | ||
echo ">>> zksync-cli dev modules" | ||
|
||
npx zksync-cli dev modules | ||
verify_result | ||
########## | ||
|
||
echo "" | ||
echo ">>> zksync-cli create" | ||
yes | npx zksync-cli create | ||
verify_result | ||
|
||
if [ $RESULT_COMMON -eq 0 ]; then | ||
echo success | ||
else | ||
echo ERROR: RESULT_COMMON = $RESULT_COMMON | ||
exit 1 # terminate and indicate error | ||
fi | ||
|