From fbd05946198c22df5a5ccc8a3134e392fae3767a Mon Sep 17 00:00:00 2001 From: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com> Date: Sun, 17 Jul 2022 23:09:52 +0530 Subject: [PATCH] Test package publish Signed-off-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com> --- .github/workflows/package-tests.yml | 37 +++++++++++++++++++ .github/workflows/pr.yml | 3 ++ .../run-with-build.sh | 3 -- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/package-tests.yml diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml new file mode 100644 index 000000000..9dccc3ca8 --- /dev/null +++ b/.github/workflows/package-tests.yml @@ -0,0 +1,37 @@ +name: Test Published Package + +on: + workflow_call: + +jobs: + package-tests: + name: Test Published Package + runs-on: ubuntu-latest + services: + verdaccio: + image: verdaccio/verdaccio + ports: + - 4873:4873 + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Install dependencies + run: npm install + working-directory: ./packages/caliper-publish + - name: Initialize npm + run: | + npm install -g npm-cli-login + npm-cli-login + env: + NPM_USER: npm_user + NPM_PASS: npm_pass + NPM_EMAIL: npm_user@test.npm + NPM_REGISTRY: http://localhost:4873 + - name: Publish Caliper + run: ./run-with-build.sh + working-directory: ./packages/caliper-tests-integration/fabric_docker_local_tests + env: + DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9f3d12d1e..c795e2aef 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,3 +13,6 @@ jobs: integration-tests: uses: ./.github/workflows/integration-tests.yml needs: unit-tests + package-tests: + uses: ./.github/workflows/package-tests.yml + needs: dci-lint diff --git a/packages/caliper-tests-integration/fabric_docker_local_tests/run-with-build.sh b/packages/caliper-tests-integration/fabric_docker_local_tests/run-with-build.sh index 678866dcc..1544e5bce 100755 --- a/packages/caliper-tests-integration/fabric_docker_local_tests/run-with-build.sh +++ b/packages/caliper-tests-integration/fabric_docker_local_tests/run-with-build.sh @@ -29,11 +29,8 @@ cd ${DIR} # Publish the packages locally and build a local test image cd ./../../caliper-publish/ -./publish.js verdaccio start -sleep 5s ./publish.js npm --registry http://localhost:4873 ./publish.js docker --registry http://localhost:4873 --image caliper --tag test -./publish.js verdaccio stop # back to this dir cd ${DIR}