Skip to content

Commit

Permalink
Merge pull request #8 from ResilientEcosystem/gopuman-test
Browse files Browse the repository at this point in the history
Update workflow and version
  • Loading branch information
gopuman authored Nov 8, 2024
2 parents e0fe5c3 + de3ab04 commit 2aac6fa
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 22 deletions.
76 changes: 55 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
Expand All @@ -13,33 +16,64 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Install ResContract CLI
run: npm install -g rescontract-cli
- name: Set up Node.js and NVM
run: |
# Install and set up Node.js and NVM
sudo apt update
sudo apt install -y nodejs npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # Loads nvm bash completion
nvm install node
sudo npm install -g n
sudo n latest
hash -r
node --version
- name: Install and Test ResilientDB with ResContract CLI
env:
ResDB_Home: ~/incubator-resilientdb # Use full path expansion
- name: Install ResilientDB
run: |
# Install ResilientDB
echo "Cloning and installing ResilientDB..."
git clone https://github.com/apache/incubator-resilientdb.git ~/incubator-resilientdb
cd ~/incubator-resilientdb
cd $HOME
git clone https://github.com/apache/incubator-resilientdb.git
cd incubator-resilientdb
./INSTALL.sh
./service/tools/contract/service_tools/start_contract_service.sh
bazel build service/tools/contract/api_tools/contract_tools
bazel build service/tools/kv/api_tools/kv_service_tools
env:
ResDB_Home: ${{ github.workspace }}/incubator-resilientdb

# Confirm build output location
echo "Listing build output files to confirm contract_tools location..."
ls -R ~/incubator-resilientdb/bazel-bin/service/tools/contract/api_tools/
- name: Set ResDB_Home and Locate Config Path
run: |
export ResDB_Home="$HOME/incubator-resilientdb"
echo "ResDB_Home=$ResDB_Home" >> $GITHUB_ENV
# Set environment variable for ResDB_Home
echo "ResDB_Home=$HOME/incubator-resilientdb" >> $GITHUB_ENV
# Locate the actual path of service.config
CONFIG_PATH=$(find "$ResDB_Home" -name "service.config" | head -n 1)
if [ -z "$CONFIG_PATH" ]; then
echo "Error: service.config not found"
exit 1
fi
echo "CONFIG_PATH=$CONFIG_PATH" >> $GITHUB_ENV
# Run CLI Tests
- name: Install ResContract CLI
run: |
cd $HOME
git clone https://github.com/ResilientEcosystem/ResContract.git
cd ResContract
sudo npm install -g
npm install commander
- name: Install Solidity Compiler (solc)
run: |
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install -y solc
- name: Run CLI Tests
env:
ResDB_Home: ${{ env.ResDB_Home }}
CONFIG_PATH: ${{ env.CONFIG_PATH }}
run: |
echo "Testing create command"
rescontract create --config ~/incubator-resilientdb/service/tools/config/interface/service.config
rescontract create --config "$CONFIG_PATH"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rescontract-cli",
"version": "1.2.2",
"version": "1.2.3",
"description": "A CLI tool for managing smart contracts in the ResilientDB ecosystem.",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 2aac6fa

Please sign in to comment.