Skip to content

Commit

Permalink
Refactor agent-core, publish as package, add signing tests (#129)
Browse files Browse the repository at this point in the history
* Refactor agent-core

* Refactor agent-core and dependent code

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Add sign/verify nodejs integration test

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Add agent-core npmjs publishing

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Skip batch_revocation test, fix nodejs integration tests

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Fix revocation integration test

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Adjust nodejs integration tests, vcxagent-core improvements, adjust ci

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Use scoped package for vcxagent-core

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Refactor vcxagent-core

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Unify vcxagent-core api style

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Update vcxagent-cli

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Specify node-vcx-wrapper as peer dependency of vcxagent-core

* Adjust dependencies

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Cleanup per code review

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Remove notion of protocol_type from vcxagent, improve proof generation

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>

* Refactor vcxagent-core

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas authored Oct 13, 2020
1 parent ad65593 commit 2820502
Show file tree
Hide file tree
Showing 38 changed files with 1,710 additions and 14,483 deletions.
62 changes: 56 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -665,31 +665,31 @@ jobs:
docker run --rm -d --name postgres --network host -e POSTGRES_PASSWORD=mysecretpassword postgres:12.1
docker run --rm -d --name vcxagency --network host --env-file ci/agency/localhost.env $DOCKER_IMG_NAME_AGENCY
- name: Run wrapper integration test
- name: Run wrapper legacy integration test
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:integration)'
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:legacy:integration)'
- name: Run wrapper integration revocation test
- name: Run wrapper legacy integration revocation test
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:integration:revocation)'
cd $HOME/agents/node/vcxagent-core && npm install && npm run test:legacy:integration:revocation)'
- name: Run wrapper api v2 integration test
- name: Run integration tests
run: |
set -x
docker run --rm -i --name libvcx --network host -e NPMJS_TOKEN=$NPMJS_TOKEN $DOCKER_IMG_NAME_LIBVCX \
bash -c '(
cd $HOME/wrappers/node && npm install && npm run compile && \
cd $HOME/agents/node/vcxagent-core && npm install && \
cd $HOME/agents/node/vcxagent-cli && npm install && \
cd $HOME/agents/node/vcxagent-core && npm run test:update-state)'
cd $HOME/agents/node/vcxagent-core && npm run test:integration)'
# TODO: Add tests of iOS build
publish-ios-wrapper:
Expand Down Expand Up @@ -925,6 +925,56 @@ jobs:
echo "New version was not defined, skipping release."
fi
publish-agent-core:
runs-on: ubuntu-16.04
needs: [workflow-setup, build-image-indypool, build-image-libvcx, test-libvcx-image-general_test, test-libvcx-image-pool_tests, test-libvcx-image-agency_pool_tests, test-node-wrapper, test-integration-node-wrapper]
env:
NPMJS_TOKEN: ${{ secrets.NPMJS_TOKEN }}
steps:
- name: Load env. variables
run: |
echo ::set-env name=CACHE_KEY_LIBVCX::$(echo ${{needs.workflow-setup.outputs.CACHE_KEY_LIBVCX}})
echo ::set-env name=DOCKER_IMG_NAME_LIBVCX::$(echo ${{needs.workflow-setup.outputs.DOCKER_IMG_NAME_LIBVCX}})
echo ::set-env name=PUBLISH_VERSION::$(echo ${{needs.workflow-setup.outputs.PUBLISH_VERSION}})
- name: Git checkout
uses: actions/checkout@v2

- name: Load libvcx image cache
id: load-cached-libvcx-image
uses: actions/cache@v2
with:
path: /tmp/imgcache
key: ${{ env.CACHE_KEY_LIBVCX }}
- name: If no cached image found
if: steps.load-cached-libvcx-image.outputs.cache-hit != 'true'
run: echo "ERROR == Expected to find image from cache $CACHE_KEY_LIBVCX"; exit -1
- name: Load image from cache
run: docker load < /tmp/imgcache/img_libvcx.rar

- name: Verify libvcx image were loaded
run: |
docker image ls --format "{{.Repository}}:{{.Tag}}" | grep "$DOCKER_IMG_NAME_LIBVCX" || { echo "Image $DOCKER_IMG_NAME_LIBVCX was not found!" ; exit 1; }
- name: Docker Login
uses: azure/docker-login@v1
with:
login-server: docker.pkg.github.com
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release agent-core package
run: |
if [[ "$PUBLISH_VERSION" ]]
then
echo "Releasing node wrapper version $PUBLISH_VERSION..."
docker run --rm -i --name libvcx --network host \
-e NPMJS_TOKEN="$NPMJS_TOKEN" \
-e PUBLISH_VERSION="$PUBLISH_VERSION" \
"$DOCKER_IMG_NAME_LIBVCX" bash -c '$HOME/agents/node/vcxagent-core/publish.sh'
else
echo "New version was not defined, skipping release."
fi
make-release:
runs-on: ubuntu-16.04
needs: [workflow-setup, build-image-indypool, build-image-libvcx, build-image-android, publish-ios-wrapper, publish-android-wrapper-device, publish-android-wrapper-emulator, test-libvcx-image-general_test, test-libvcx-image-pool_tests, test-libvcx-image-agency_pool_tests, test-android-build, test-node-wrapper, test-integration-node-wrapper]
Expand Down
Loading

0 comments on commit 2820502

Please sign in to comment.