Skip to content

Commit

Permalink
update: simplify ci definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Barber0 committed Feb 22, 2024
1 parent 6920971 commit 02ac8c9
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 203 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/aspect-test-v2.yaml

This file was deleted.

150 changes: 77 additions & 73 deletions .github/workflows/aspect-test.yaml
Original file line number Diff line number Diff line change
@@ -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 <<EOF
source ~/.nvm/nvm.sh
set -ex
cd /aspect-tooling/packages/testcases
sed -i "s|\"node\": \".*\"|\"node\": \"$test_node_addr\"|g" project.config.json && cat project.config.json
# key1
echo $key_attack_accounts > 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!
- 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
37 changes: 0 additions & 37 deletions .github/workflows/jsonrpc-test-v2.yaml

This file was deleted.

35 changes: 28 additions & 7 deletions .github/workflows/jsonrpc-test.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"
test-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Preparation
run: |
mkdir -p ci_scripts
cat > ci_scripts/init_env.sh <<EOF
source ~/.nvm/nvm.sh
set -ex
cd /test-scripts/pre_public_testnet/json-rpc
sed -i "s|\"node\": \".*\"|\"node\": \"$test_node_addr\"|g" project.config.json && cat project.config.json
echo $key_privateKey > 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
Loading

0 comments on commit 02ac8c9

Please sign in to comment.