diff --git a/.github/workflows/aspect-test-v2.yaml b/.github/workflows/aspect-test-v2.yaml deleted file mode 100644 index 5c5a6694..00000000 --- a/.github/workflows/aspect-test-v2.yaml +++ /dev/null @@ -1,86 +0,0 @@ -name: Aspect Test V2 - -env: - test_node_addr: "https://betanet-rpc1.artela.network" - key_privateKey: "0xa9e70c59c34171623b5aceba9976288912bd45539d4029188836914e24decdd5" - key_attack_accounts: "0xaf919292bab87f4f9b13ce45406023bca55953a34682039298a7048f1c7e99b7" - key_aspect_accounts: "0xcf8e42a2dc63d0b38ef004ecd2e2a6478158a84b4772ff244093961cae348ae8" - -on: - push: - branches: [ ci_test ] - pull_request: - branches: [ ci_test ] - -jobs: - test-job: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Preparation - run: | - mkdir -p test_scripts - cat > test_scripts/init_env.sh < attack_accounts.txt - # key2 - echo $key_privateKey > privateKey.txt - # key3 - echo $key_aspect_accounts > aspect_accounts.txt - - cd tests - node $1 - EOF - cat > test_scripts/run.sh << EOF - docker run --rm --name testenv -v $(pwd)/test_scripts:/test_scripts -i simonalphafang/aspect-tooling:0.0.4 /bin/bash -c /test_scripts/init_env.sh $1 - EOF - chmod +x -R test_scripts/ - - - name: context-aspect.test.js - run: bash -c test_scripts/run.sh context-aspect.test.js - - name: context-permission-check.test.js - run: bash -c test_scripts/run.sh context-permission-check.test.js - - name: contract-aspect.test.js - run: bash -c test_scripts/run.sh contract-aspect.test.js - - name: cross-phase-property.test.js - run: bash -c test_scripts/run.sh cross-phase-property.test.js - - name: cross-phase-property.test.js - run: bash -c test_scripts/run.sh cross-phase-property.test.js - - name: crypto-ecrecover-aspect.test.js - run: bash -c test_scripts/run.sh crypto-ecrecover-aspect.test.js - - name: crypto-hash-aspect.test.js - run: bash -c test_scripts/run.sh crypto-hash-aspect.test.js - - name: eoa-test-aspect.test.js - run: bash -c test_scripts/run.sh eoa-test-aspect.test.js - - name: guard-by-count.test.js - run: bash -c test_scripts/run.sh guard-by-count.test.js - - name: guard-by-lock.test.js - run: bash -c test_scripts/run.sh guard-by-lock.test.js - - name: guard-by-trace.test.js - run: bash -c test_scripts/run.sh guard-by-trace.test.js - - name: invalid-jit-call-aspect.test.js - run: bash -c test_scripts/run.sh invalid-jit-call-aspect.test.js - - name: invalid-static-call-test-aspect.test.js - run: bash -c test_scripts/run.sh invalid-static-call-test-aspect.test.js - - name: multi-read-write-check.test.js - run: bash -c test_scripts/run.sh multi-read-write-check.test.js - - name: operation-aspect.test.js - run: bash -c test_scripts/run.sh operation-aspect.test.js - - name: state-aspect.test.js - run: bash -c test_scripts/run.sh state-aspect.test.js - - name: statedb-aspect.test.js - run: bash -c test_scripts/run.sh statedb-aspect.test.js - - name: static-call-aspect.test.js - run: bash -c test_scripts/run.sh static-call-aspect.test.js - - name: storage-aspect.test.js - run: bash -c test_scripts/run.sh storage-aspect.test.js - - name: type-check-aspect.test.js - run: bash -c test_scripts/run.sh type-check-aspect.test.js - - name: upgrade-test-aspect.test.js - run: bash -c test_scripts/run.sh upgrade-test-aspect.test.js - - name: verify-aspect.test.js - run: bash -c test_scripts/run.sh verify-aspect.test.js diff --git a/.github/workflows/aspect-test.yaml b/.github/workflows/aspect-test.yaml index 571729f3..5c5a6694 100644 --- a/.github/workflows/aspect-test.yaml +++ b/.github/workflows/aspect-test.yaml @@ -1,82 +1,86 @@ -name: Aspect Test +name: Aspect Test V2 + +env: + test_node_addr: "https://betanet-rpc1.artela.network" + key_privateKey: "0xa9e70c59c34171623b5aceba9976288912bd45539d4029188836914e24decdd5" + key_attack_accounts: "0xaf919292bab87f4f9b13ce45406023bca55953a34682039298a7048f1c7e99b7" + key_aspect_accounts: "0xcf8e42a2dc63d0b38ef004ecd2e2a6478158a84b4772ff244093961cae348ae8" on: push: branches: [ ci_test ] pull_request: branches: [ ci_test ] - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Test scenario tags' - required: false jobs: - type-check: - uses: ./.github/workflows/reuseable-aspect-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "type-check-aspect.test.js" - key_privateKey: "0xb4f7eb534165f83025bc30f0add655805d9da066ef2bca04e59fb6f74c38acb8" - key_attack_accounts: "" - key_aspect_accounts: "" - - cross-phase-property: - uses: ./.github/workflows/reuseable-aspect-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "cross-phase-property.test.js" - key_attack_accounts: "0xc107af871261252e19185507a416efc753b4255f05ff2a2f7e54eee3f68968c7" - key_privateKey: "0xa1e399c54e92cc32a19fb10e41467ee5a67c08a922600f8dd3774e375c868c33" - key_aspect_accounts: "0x4d372700bec7a86e3b5388685f92806234931bc018c02fe4b52d5c56df317f8en" - - cross-phase-state: - uses: ./.github/workflows/reuseable-aspect-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "cross-phase-state.test.js" - key_attack_accounts: "0x37fdcc21797ca54da32a07a81a50750b40be2438c99ba73effe3c5c1c50d7cd9" - key_privateKey: "0x08a144f99aeae08b9582eef04c82f51528d6fc9ac0680ce4f967b872bbb3ab0e" - key_aspect_accounts: "0x7e026200e55f7fd162ba0bc8dbb8ae5e37c11ebf808c7981c4eba3aa6fe4c91c" - - context-aspect: - uses: ./.github/workflows/reuseable-aspect-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "context-aspect.test.js" - key_attack_accounts: "" - key_privateKey: "0x6b8fdf2fe277f04f2b4b79695cac237e6bfcfa711f8d374404d4fbb1e8891865" - key_aspect_accounts: "" - - context-perm-check: - uses: ./.github/workflows/reuseable-aspect-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "context-permission-check.test.js" - key_attack_accounts: "" - key_privateKey: "0x91f6dc1e7bd0d5c1b2810865825bfaa926062a5d0f8f608019efc051365b8c91" - key_aspect_accounts: "" - + test-job: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Preparation + run: | + mkdir -p test_scripts + cat > test_scripts/init_env.sh < attack_accounts.txt + # key2 + echo $key_privateKey > privateKey.txt + # key3 + echo $key_aspect_accounts > aspect_accounts.txt + + cd tests + node $1 + EOF + cat > test_scripts/run.sh << EOF + docker run --rm --name testenv -v $(pwd)/test_scripts:/test_scripts -i simonalphafang/aspect-tooling:0.0.4 /bin/bash -c /test_scripts/init_env.sh $1 + EOF + chmod +x -R test_scripts/ -# name: Manual workflow -# on: -# workflow_dispatch: -# inputs: -# logLevel: -# description: 'Log level' -# required: true -# default: 'warning' -# tags: -# description: 'Test scenario tags' -# required: false -# jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: Run a one-line script -# run: echo Hello, world! \ No newline at end of file + - name: context-aspect.test.js + run: bash -c test_scripts/run.sh context-aspect.test.js + - name: context-permission-check.test.js + run: bash -c test_scripts/run.sh context-permission-check.test.js + - name: contract-aspect.test.js + run: bash -c test_scripts/run.sh contract-aspect.test.js + - name: cross-phase-property.test.js + run: bash -c test_scripts/run.sh cross-phase-property.test.js + - name: cross-phase-property.test.js + run: bash -c test_scripts/run.sh cross-phase-property.test.js + - name: crypto-ecrecover-aspect.test.js + run: bash -c test_scripts/run.sh crypto-ecrecover-aspect.test.js + - name: crypto-hash-aspect.test.js + run: bash -c test_scripts/run.sh crypto-hash-aspect.test.js + - name: eoa-test-aspect.test.js + run: bash -c test_scripts/run.sh eoa-test-aspect.test.js + - name: guard-by-count.test.js + run: bash -c test_scripts/run.sh guard-by-count.test.js + - name: guard-by-lock.test.js + run: bash -c test_scripts/run.sh guard-by-lock.test.js + - name: guard-by-trace.test.js + run: bash -c test_scripts/run.sh guard-by-trace.test.js + - name: invalid-jit-call-aspect.test.js + run: bash -c test_scripts/run.sh invalid-jit-call-aspect.test.js + - name: invalid-static-call-test-aspect.test.js + run: bash -c test_scripts/run.sh invalid-static-call-test-aspect.test.js + - name: multi-read-write-check.test.js + run: bash -c test_scripts/run.sh multi-read-write-check.test.js + - name: operation-aspect.test.js + run: bash -c test_scripts/run.sh operation-aspect.test.js + - name: state-aspect.test.js + run: bash -c test_scripts/run.sh state-aspect.test.js + - name: statedb-aspect.test.js + run: bash -c test_scripts/run.sh statedb-aspect.test.js + - name: static-call-aspect.test.js + run: bash -c test_scripts/run.sh static-call-aspect.test.js + - name: storage-aspect.test.js + run: bash -c test_scripts/run.sh storage-aspect.test.js + - name: type-check-aspect.test.js + run: bash -c test_scripts/run.sh type-check-aspect.test.js + - name: upgrade-test-aspect.test.js + run: bash -c test_scripts/run.sh upgrade-test-aspect.test.js + - name: verify-aspect.test.js + run: bash -c test_scripts/run.sh verify-aspect.test.js diff --git a/.github/workflows/jsonrpc-test-v2.yaml b/.github/workflows/jsonrpc-test-v2.yaml deleted file mode 100644 index cdbf425e..00000000 --- a/.github/workflows/jsonrpc-test-v2.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: JsonRPC Test - -env: - test_node_addr: "https://betanet-rpc1.artela.network" - key_privateKey: "0xa9e70c59c34171623b5aceba9976288912bd45539d4029188836914e24decdd5" - -on: - push: - branches: [ ci_test ] - pull_request: - branches: [ ci_test ] - -jobs: - test-job: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Preparation - run: | - mkdir -p ci_scripts - - cat > ci_scripts/init_env.sh < privateKey.txt - node $1 - EOF - - cat > ci_scripts/run.sh << EOF - docker run --name testenv -v $(pwd)/ci_scripts:/ci_scripts -i simonalphafang/artela-jsonrpc-testenv:0.0.1 /bin/bash -c /ci_scripts/init_env.sh $1 - EOF - chmod +x -R ci_scripts/ - - - name: ci_call.js - run: bash -c ci_scripts/run.sh ci_call.js diff --git a/.github/workflows/jsonrpc-test.yaml b/.github/workflows/jsonrpc-test.yaml index b13d8cd4..f59c50ba 100644 --- a/.github/workflows/jsonrpc-test.yaml +++ b/.github/workflows/jsonrpc-test.yaml @@ -1,5 +1,8 @@ name: JsonRPC Test -# Test cases for json-rpc + +env: + test_node_addr: "https://betanet-rpc1.artela.network" + key_privateKey: "0x4d372700bec7a86e3b5388685f92806234931bc018c02fe4b52d5c56df317f8e" on: push: @@ -8,9 +11,27 @@ on: branches: [ ci_test ] jobs: - jsonrpc-ci-call: - uses: ./.github/workflows/reuseable-jsonrpc-test.yaml - with: - test_node_addr: "http://47.254.27.97:8545" - test_script: "ci_call.cjs" - key_privateKey: "0x8778bb32408d744cfc2c9da02499783b65d0261895acb3e27e0b4f63c07f9329" \ No newline at end of file + test-job: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Preparation + run: | + mkdir -p ci_scripts + + cat > ci_scripts/init_env.sh < privateKey.txt + node $1 + EOF + + cat > ci_scripts/run.sh << EOF + docker run --name testenv -v $(pwd)/ci_scripts:/ci_scripts -i simonalphafang/artela-jsonrpc-testenv:0.0.1 /bin/bash -c /ci_scripts/init_env.sh $1 + EOF + chmod +x -R ci_scripts/ + + - name: ci_call.js + run: bash -c ci_scripts/run.sh ci_call.js diff --git a/.github/workflows_v1/aspect-test.yaml b/.github/workflows_v1/aspect-test.yaml new file mode 100644 index 00000000..4198169e --- /dev/null +++ b/.github/workflows_v1/aspect-test.yaml @@ -0,0 +1,82 @@ +# name: Aspect Test + +# on: +# push: +# branches: [ ci_test ] +# pull_request: +# branches: [ ci_test ] +# workflow_dispatch: +# inputs: +# logLevel: +# description: 'Log level' +# required: true +# default: 'warning' +# tags: +# description: 'Test scenario tags' +# required: false + +# jobs: +# type-check: +# uses: ./.github/workflows/reuseable-aspect-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "type-check-aspect.test.js" +# key_privateKey: "0xb4f7eb534165f83025bc30f0add655805d9da066ef2bca04e59fb6f74c38acb8" +# key_attack_accounts: "" +# key_aspect_accounts: "" + +# cross-phase-property: +# uses: ./.github/workflows/reuseable-aspect-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "cross-phase-property.test.js" +# key_attack_accounts: "0xc107af871261252e19185507a416efc753b4255f05ff2a2f7e54eee3f68968c7" +# key_privateKey: "0xa1e399c54e92cc32a19fb10e41467ee5a67c08a922600f8dd3774e375c868c33" +# key_aspect_accounts: "0x4d372700bec7a86e3b5388685f92806234931bc018c02fe4b52d5c56df317f8en" + +# cross-phase-state: +# uses: ./.github/workflows/reuseable-aspect-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "cross-phase-state.test.js" +# key_attack_accounts: "0x37fdcc21797ca54da32a07a81a50750b40be2438c99ba73effe3c5c1c50d7cd9" +# key_privateKey: "0x08a144f99aeae08b9582eef04c82f51528d6fc9ac0680ce4f967b872bbb3ab0e" +# key_aspect_accounts: "0x7e026200e55f7fd162ba0bc8dbb8ae5e37c11ebf808c7981c4eba3aa6fe4c91c" + +# context-aspect: +# uses: ./.github/workflows/reuseable-aspect-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "context-aspect.test.js" +# key_attack_accounts: "" +# key_privateKey: "0x6b8fdf2fe277f04f2b4b79695cac237e6bfcfa711f8d374404d4fbb1e8891865" +# key_aspect_accounts: "" + +# context-perm-check: +# uses: ./.github/workflows/reuseable-aspect-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "context-permission-check.test.js" +# key_attack_accounts: "" +# key_privateKey: "0x91f6dc1e7bd0d5c1b2810865825bfaa926062a5d0f8f608019efc051365b8c91" +# key_aspect_accounts: "" + + +# # name: Manual workflow +# # on: +# # workflow_dispatch: +# # inputs: +# # logLevel: +# # description: 'Log level' +# # required: true +# # default: 'warning' +# # tags: +# # description: 'Test scenario tags' +# # required: false +# # jobs: +# # build: +# # runs-on: ubuntu-latest +# # steps: +# # - uses: actions/checkout@v2 +# # - name: Run a one-line script +# # run: echo Hello, world! \ No newline at end of file diff --git a/.github/workflows_v1/jsonrpc-test.yaml b/.github/workflows_v1/jsonrpc-test.yaml new file mode 100644 index 00000000..16ab331c --- /dev/null +++ b/.github/workflows_v1/jsonrpc-test.yaml @@ -0,0 +1,16 @@ +# name: JsonRPC Test +# # Test cases for json-rpc + +# on: +# push: +# branches: [ ci_test ] +# pull_request: +# branches: [ ci_test ] + +# jobs: +# jsonrpc-ci-call: +# uses: ./.github/workflows/reuseable-jsonrpc-test.yaml +# with: +# test_node_addr: "http://47.254.27.97:8545" +# test_script: "ci_call.cjs" +# key_privateKey: "0x8778bb32408d744cfc2c9da02499783b65d0261895acb3e27e0b4f63c07f9329" \ No newline at end of file diff --git a/.github/workflows/reuseable-aspect-test.yaml b/.github/workflows_v1/reuseable-aspect-test.yaml similarity index 100% rename from .github/workflows/reuseable-aspect-test.yaml rename to .github/workflows_v1/reuseable-aspect-test.yaml diff --git a/.github/workflows/reuseable-jsonrpc-test.yaml b/.github/workflows_v1/reuseable-jsonrpc-test.yaml similarity index 100% rename from .github/workflows/reuseable-jsonrpc-test.yaml rename to .github/workflows_v1/reuseable-jsonrpc-test.yaml