diff --git a/Dockerfile b/Dockerfile index 712578c..9c43ebb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ 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 ./scripts COPY --chown=0:0 ./scripts/setup_provenance.sh /setup_provenance.sh # install jq for parsing output of queries when running Provenance diff --git a/README.md b/README.md index a59fc4f..03570d2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Github action to simplify testing with the Provenance blockchain. ### Summary This action setups up Provenance in a docker container and allows the user to pass in both the version of provenance to use as well as a test script. After Provenance is up running the test script is executed. This allows testing of any of Provenance's features inside of this docker container as part of a github release process. -### Use +### Use as a github action For an example of this in use look at the smart contract tests in `provwasm` [link](https://github.com/provenance-io/provwasm/blob/main/.github/workflows/test.yml#L55) This action is published and can be brought into any project with the following: @@ -16,4 +16,20 @@ This action is published and can be brought into any project with the following: with: provenance_version: "v1.8.0" test_script: "./scripts/name_test.sh" +``` + +### Use as a docker image +The docker image is deployed at: https://hub.docker.com/r/provenanceio/provenance-testing-action + +This image can be downloaded and run. However to do so, instead of just running the image you will need to pull the image, create a container, copy the test script and any files it needs into the container and then run it like the following pulled from the `Makefile` in [Provwasm](https://github.com/provenance-io/provwasm) + +```Makefile +.PHONY: test-tutorial +test-tutorial: tutorial optimize-tutorial + docker rm -f test_container || true + docker pull provenanceio/provenance-testing-action + docker create --name test_container provenanceio/provenance-testing-action --entrypoint "/scripts/tutorial_test.sh" "$(PROVENANCE_TEST_VERSION)" + docker cp ./scripts test_container:/scripts + docker cp ./contracts test_container:/go/contracts + docker start test_container ``` \ No newline at end of file diff --git a/scripts/setup_provenance.sh b/scripts/setup_provenance.sh index f4c834c..1b1ec0d 100755 --- a/scripts/setup_provenance.sh +++ b/scripts/setup_provenance.sh @@ -2,10 +2,7 @@ # This script setups up Provenance and then runs a script it receives as an argument to do various tests afterwards -echo "Arguments:" -echo "$@" - -# get last argument as Provenance version +# get the last argument as Provenance version (This is because of a difference between running as a docker image and as a github action) Provenance_Version=${@: -1} echo "Provenance Version:"