Skip to content

Commit

Permalink
Added test workflow for basic neoxp commands (neo-project#356)
Browse files Browse the repository at this point in the history
* Test init

* update pr.yml

* udpate pr.yml

* added prerelease to install

* quick test

* basic tests for neo-express node are setup

* removed old neoxp test in test.yml

* added cron back

---------

Co-authored-by: Jimmy <jinghui@wayne.edu>
cschuchardt88 and Jim8y authored Nov 22, 2023
1 parent b2feec5 commit 8bab177
Showing 4 changed files with 67 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ on:
- '.gitattributes'
- 'LICENSE'
- '**/*.md'
schedule:
- cron: '35 10 * * 3'

jobs:
analyze:
62 changes: 62 additions & 0 deletions .github/workflows/neoxp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Neo Express

on:
workflow_call:

env:
AZURE_ARTIFACTS_FEED_URL: https://nuget.pkg.github.com/neo-project/index.json
DOTNET_VERSION: '7.0.x'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
source-url: ${{ env.AZURE_ARTIFACTS_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download Express
uses: actions/download-artifact@v3
with:
name: express
path: ./out

- name: Install Neo Express
run: dotnet tool install --add-source ./out --verbosity normal --global --prerelease neo.express

- name: Test Create Command
run: neoxp create

- name: Test Checkpoint Command (offline)
run: neoxp checkpoint create checkpoints/init --force

- name: Test Policy Command (offline)
run: |
neoxp policy get --rpc-uri mainnet --json > mainnet-policy.json
neoxp policy sync mainnet-policy genesis
- name: Test Wallet Command
run: |
neoxp wallet create bob
- name: Test Transfer Command (offline)
run: |
neoxp transfer 10000 gas genesis node1
neoxp transfer 10000 gas genesis bob
- name: Test Run Command (online)
timeout-minutes: 1
run: neoxp run --seconds-per-block 3 --discard &

- name: Test Transfer Command (online)
run: |
neoxp transfer 10000 gas genesis node1
neoxp transfer 10000 gas genesis bob
- name: Test Stop Command (online)
run: neoxp stop --all

3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -16,3 +16,6 @@ jobs:
uses: ./.github/workflows/pack.yml
test:
uses: ./.github/workflows/test.yml
neoxp:
needs: [pack, test]
uses: ./.github/workflows/neoxp.yml
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -32,17 +32,6 @@ jobs:
dotnet restore neo-express.sln
dotnet build neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.${{ matrix.os }}.binlog
dotnet test neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Test Neo Express Blockchain & Commands (non-dotnet)
run: |
cd ./src/neoxp/bin/Release/net7.0
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
./neoxp create
./neoxp transfer 1 gas genesis node1
else
./neoxp.exe create
./neoxp.exe transfer 1 gas genesis node1
fi
shell: bash
- name: Upload Coverage
uses: actions/upload-artifact@v3
with:

0 comments on commit 8bab177

Please sign in to comment.