Skip to content

Commit

Permalink
added the action info
Browse files Browse the repository at this point in the history
  • Loading branch information
fkneeland-figure committed Mar 22, 2022
1 parent d6c2bf8 commit c4f2007
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
Empty file added .gitignore
Empty file.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Docker file for testing provwasm
FROM golang:1.17-buster as build
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libleveldb-dev
RUN apt-get install -y unzip

COPY --chown=0:0 ./scripts/setup_provenance.sh /setup_provenance.sh

# install jq for parsing output of queries when running Provenance
RUN curl -o /usr/local/bin/jq http://stedolan.github.io/jq/download/linux64/jq && \
chmod +x /usr/local/bin/jq

# Initialize provenance to run with the default node configuration
ENTRYPOINT ["/setup_provenance.sh"]
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# action.yml
name: 'Provenance Test'
description: 'Action to test Provenance'
inputs:
provenance_version: # version of Provenance
description: 'Version of Provenance to test against'
required: true
default: 'v1.8.0'
test_script:
description: 'Script used to run tests after provenance has been setup and is running'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.test_script }}
- ${{ inputs.provenance_version }}
45 changes: 45 additions & 0 deletions scripts/setup_provenance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash -e

# This script setups up Provenance and then runs a script it receives as an argument to do various tests afterwards

Provenance_Version=$2

wget "https://github.com/provenance-io/provenance/releases/download/$Provenance_Version/provenance-linux-amd64-$Provenance_Version.zip"

# this will create a folder with both provenance and libwasm
unzip "provenance-linux-amd64-$Provenance_Version.zip"

mkdir ./build

PROV_CMD="./bin/provenanced"
PIO_HOME="./build"
export PIO_HOME

if [ ! -d "$PIO_HOME/config" ]; then
"$PROV_CMD" -t init --chain-id=testing testing
"$PROV_CMD" -t keys add validator --keyring-backend test
"$PROV_CMD" -t add-genesis-root-name validator pio --keyring-backend test
"$PROV_CMD" -t add-genesis-root-name validator pb --restrict=false \
--keyring-backend test
"$PROV_CMD" -t add-genesis-root-name validator io --restrict \
--keyring-backend test
"$PROV_CMD" -t add-genesis-root-name validator provenance \
--keyring-backend test
"$PROV_CMD" -t add-genesis-account validator 100000000000000000000nhash \
--keyring-backend test
"$PROV_CMD" -t gentx validator 1000000000000000nhash \
--keyring-backend test --chain-id=testing
"$PROV_CMD" -t add-genesis-marker 100000000000000000000nhash --manager \
validator --access mint,burn,admin,withdraw,deposit \
--activate --keyring-backend test
"$PROV_CMD" -t collect-gentxs
fi
nohup "$PROV_CMD" -t start &>/dev/null &

echo "Sleeping for provenance to start up"
sleep 10s

# execute the script test that was passed in as an argument
echo "Executing test..."
"$1"
echo "Test complete"

0 comments on commit c4f2007

Please sign in to comment.