Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor agent-core, publish as package, add signing tests #129

Merged
merged 16 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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