From 20abf2ccc28fd5b9ae3e7109acf98aec4b9d171f Mon Sep 17 00:00:00 2001 From: jagpreetsinghsasan Date: Tue, 5 Nov 2024 04:14:59 +0000 Subject: [PATCH] TESTING Signed-off-by: jagpreetsinghsasan --- .github/workflows/actionlint.yaml | 96 - .../all-nodejs-packages-publish.yaml | 107 - .../workflows/besu-all-in-one-publish.yaml | 56 - .../cacti-dev-container-vscode-publish.yaml | 65 - .github/workflows/ci.yaml | 2290 ----------------- .github/workflows/ci_weaver.yaml | 67 - .github/workflows/cmd-api-server-publish.yaml | 56 - .github/workflows/codeql-analysis.yml | 70 - .../workflows/commitlint-pull-request.yaml | 15 - .github/workflows/connector-besu-publish.yaml | 56 - .../connector-corda-server-publish.yaml | 56 - .../workflows/connector-fabric-publish.yaml | 56 - .github/workflows/coverage_ts.yaml | 59 - .../workflows/daml-all-in-one-publish.yaml | 56 - .github/workflows/dco.yaml | 19 - .github/workflows/dependent-issues.yaml | 41 - .github/workflows/deploy_docs.yml | 57 - .../dev-container-vscode-publish.yaml | 59 - .../example-carbon-accounting-publish.yaml | 56 - .../example-supply-chain-app-publish.yaml | 56 - .../workflows/fabric2-all-in-one-publish.yaml | 56 - .../workflows/geth-all-in-one-publish.yaml | 56 - .github/workflows/gg-shield-action.yaml | 36 - .../ghpkg-all-kotlin-api-clients-publish.yaml | 263 -- .../workflows/iroha2-all-in-one-publish.yaml | 56 - .../keychain-vault-server-publish.yaml | 56 - .github/workflows/pr-commit-parity.yaml | 15 - .github/workflows/publish-npm.yaml | 46 - .../sawtooth-all-in-one-publish.yaml | 56 - .github/workflows/scorecard.yml | 78 - .github/workflows/semantic-pull-request.yaml | 21 - .../test_weaver-asset-exchange-besu.yaml | 412 --- .../test_weaver-asset-exchange-corda.yaml | 342 --- .../test_weaver-asset-exchange-fabric.yaml | 208 -- .../workflows/test_weaver-asset-transfer.yaml | 1366 ---------- .../test_weaver-corda-interop-app.yaml | 62 - .../workflows/test_weaver-data-sharing.yaml | 1268 --------- .../workflows/test_weaver-docker-build.yaml | 218 -- .../test_weaver-fabric-fabric-satp.yaml | 198 -- .github/workflows/test_weaver-go.yaml | 350 --- .github/workflows/test_weaver-node-pkgs.yaml | 156 -- .../workflows/test_weaver-pre-release.yaml | 171 -- .github/workflows/test_weaver-relay.yaml | 220 -- .../workflows/weaver_deploy_corda-pkgs.yml | 171 -- .github/workflows/weaver_deploy_go-pkgs.yml | 429 --- .github/workflows/weaver_deploy_node-pkgs.yml | 240 -- .../workflows/weaver_deploy_relay-server.yml | 83 - 47 files changed, 10026 deletions(-) delete mode 100644 .github/workflows/actionlint.yaml delete mode 100644 .github/workflows/all-nodejs-packages-publish.yaml delete mode 100644 .github/workflows/besu-all-in-one-publish.yaml delete mode 100644 .github/workflows/cacti-dev-container-vscode-publish.yaml delete mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/ci_weaver.yaml delete mode 100644 .github/workflows/cmd-api-server-publish.yaml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/commitlint-pull-request.yaml delete mode 100644 .github/workflows/connector-besu-publish.yaml delete mode 100644 .github/workflows/connector-corda-server-publish.yaml delete mode 100644 .github/workflows/connector-fabric-publish.yaml delete mode 100644 .github/workflows/coverage_ts.yaml delete mode 100644 .github/workflows/daml-all-in-one-publish.yaml delete mode 100644 .github/workflows/dco.yaml delete mode 100644 .github/workflows/dependent-issues.yaml delete mode 100644 .github/workflows/deploy_docs.yml delete mode 100644 .github/workflows/dev-container-vscode-publish.yaml delete mode 100644 .github/workflows/example-carbon-accounting-publish.yaml delete mode 100644 .github/workflows/example-supply-chain-app-publish.yaml delete mode 100644 .github/workflows/fabric2-all-in-one-publish.yaml delete mode 100644 .github/workflows/geth-all-in-one-publish.yaml delete mode 100644 .github/workflows/gg-shield-action.yaml delete mode 100644 .github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml delete mode 100644 .github/workflows/iroha2-all-in-one-publish.yaml delete mode 100644 .github/workflows/keychain-vault-server-publish.yaml delete mode 100644 .github/workflows/pr-commit-parity.yaml delete mode 100644 .github/workflows/publish-npm.yaml delete mode 100644 .github/workflows/sawtooth-all-in-one-publish.yaml delete mode 100644 .github/workflows/scorecard.yml delete mode 100644 .github/workflows/semantic-pull-request.yaml delete mode 100644 .github/workflows/test_weaver-asset-exchange-besu.yaml delete mode 100644 .github/workflows/test_weaver-asset-exchange-corda.yaml delete mode 100644 .github/workflows/test_weaver-asset-exchange-fabric.yaml delete mode 100644 .github/workflows/test_weaver-asset-transfer.yaml delete mode 100644 .github/workflows/test_weaver-corda-interop-app.yaml delete mode 100644 .github/workflows/test_weaver-data-sharing.yaml delete mode 100644 .github/workflows/test_weaver-docker-build.yaml delete mode 100644 .github/workflows/test_weaver-fabric-fabric-satp.yaml delete mode 100644 .github/workflows/test_weaver-go.yaml delete mode 100644 .github/workflows/test_weaver-node-pkgs.yaml delete mode 100644 .github/workflows/test_weaver-pre-release.yaml delete mode 100644 .github/workflows/test_weaver-relay.yaml delete mode 100644 .github/workflows/weaver_deploy_corda-pkgs.yml delete mode 100644 .github/workflows/weaver_deploy_go-pkgs.yml delete mode 100644 .github/workflows/weaver_deploy_node-pkgs.yml delete mode 100644 .github/workflows/weaver_deploy_relay-server.yml diff --git a/.github/workflows/actionlint.yaml b/.github/workflows/actionlint.yaml deleted file mode 100644 index 37b2c4280f3..00000000000 --- a/.github/workflows/actionlint.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: Lint GitHub Actions workflows -on: - workflow_call: - -jobs: - Lint_GitHub_Actions: - runs-on: ubuntu-22.04 - steps: - - name: git_clone - uses: actions/checkout@v4.1.7 - - # We need to wipe the root package.json file because the installation of actionlint fails otherwise like this: - # - # npm ERR! code ERESOLVE - # npm ERR! ERESOLVE could not resolve - # npm ERR! - # npm ERR! While resolving: react-scripts@5.0.1 - # npm ERR! Found: typescript@5.3.3 - # npm ERR! node_modules/typescript - # npm ERR! dev typescript@"5.3.3" from the root project - # npm ERR! peerOptional typescript@">=3.7.2" from tap@16.3.8 - # npm ERR! node_modules/tap - # npm ERR! dev tap@"16.3.8" from the root project - # npm ERR! 25 more (ts-jest, @hyperledger/cactus-plugin-satp-hermes, ...) - # npm ERR! - # npm ERR! Could not resolve dependency: - # npm ERR! peerOptional typescript@"^3.2.1 || ^4" from react-scripts@5.0.1 - # npm ERR! node_modules/react-scripts - # npm ERR! react-scripts@"5.0.1" from @hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! examples/cactus-example-cbdc-bridging-frontend - # npm ERR! @hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! node_modules/@hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! workspace examples/cactus-example-cbdc-bridging-frontend from the root project - # npm ERR! - # npm ERR! Conflicting peer dependency: typescript@4.9.5 - # npm ERR! node_modules/typescript - # npm ERR! peerOptional typescript@"^3.2.1 || ^4" from react-scripts@5.0.1 - # npm ERR! node_modules/react-scripts - # npm ERR! react-scripts@"5.0.1" from @hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! examples/cactus-example-cbdc-bridging-frontend - # npm ERR! @hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! node_modules/@hyperledger/cacti-example-cbdc-bridging-frontend - # npm ERR! workspace examples/cactus-example-cbdc-bridging-frontend from the root project - # npm ERR! - # npm ERR! Fix the upstream dependency conflict, or retry - # npm ERR! this command with --force or --legacy-peer-deps - # npm ERR! to accept an incorrect (and potentially broken) dependency resolution. - - name: wipe_non_yaml_sources - run: rm -rf packages/ examples/ extensions/ package.json weaver/ - - # Shellcheck comlains that inside single quotes - # the environment variables are not expanded, but that's exactly what we want here because - # we are replacing environment variables inside the configuration file. - # The only way we know how to ignore a file is to delete it... - - name: wipe_files_with_false_positives - run: rm .github/workflows/all-nodejs-packages-publish.yaml - - # We need to exclude these from the linting process for now because these files have - # hundreds of linter errors that we didn't yet have time to fix. Once the errors are fixed - # we can add the files. - - name: Set env.CACTI_ACTIONLINT_FILES_TO_LINT - id: set_env_cacti_actionlint_files_to_lint - run: | - echo "CACTI_ACTIONLINT_FILES_TO_LINT=$(find .github/workflows/ -name "*.yml" -o -name "*.yaml" ! -name "*weaver*" -exec echo -n '{},' \;)" >> "$GITHUB_ENV" - - - name: Print env.CACTI_ACTIONLINT_FILES_TO_LINT - id: print_env_cacti_actionlint_files_to_lint - run: | - echo "${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }}" - - - name: Print Line-byLine env.CACTI_ACTIONLINT_FILES_TO_LINT - id: print_line_by_line_env_cacti_actionlint_files_to_lint - run: | - echo "${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }}" | tr ',' '\n' - - - name: actionlint - id: actionlint - uses: raven-actions/actionlint@v2.0.0 - with: - version: 1.7.1 - cache: true - files: ${{ env.CACTI_ACTIONLINT_FILES_TO_LINT }} - flags: '--verbose' - - - name: actionlint_summary - if: ${{ steps.actionlint.outputs.exit-code != 0 }} # example usage, do echo only when actionlint action failed - run: | - echo "Used actionlint version ${{ steps.actionlint.outputs.version-semver }}" - echo "Used actionlint release ${{ steps.actionlint.outputs.version-tag }}" - echo "actionlint ended with ${{ steps.actionlint.outputs.exit-code }} exit code" - echo "actionlint ended because '${{ steps.actionlint.outputs.exit-message }}'" - echo "actionlint found ${{ steps.actionlint.outputs.total-errors }} errors" - echo "actionlint checked ${{ steps.actionlint.outputs.total-files }} files" - echo "actionlint cache used: ${{ steps.actionlint.outputs.cache-hit }}" - echo "${{ steps.actionlint.outputs.exit-code }}" >&2 - exit 1 diff --git a/.github/workflows/all-nodejs-packages-publish.yaml b/.github/workflows/all-nodejs-packages-publish.yaml deleted file mode 100644 index 62375735b5f..00000000000 --- a/.github/workflows/all-nodejs-packages-publish.yaml +++ /dev/null @@ -1,107 +0,0 @@ -name: all-nodejs-packages-publish - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - tags: - - v* - workflow_dispatch: - inputs: - GIT_TAG_TO_PUBLISH: - description: 'The specific git tag to publish' - required: false - default: '' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-and-publish-packages: - runs-on: ubuntu-22.04 - steps: - - name: Print Workflow inputs.GIT_TAG_TO_PUBLISH - run: | - echo "inputs.GIT_TAG_TO_PUBLISH=${{ inputs.GIT_TAG_TO_PUBLISH }}" - - - uses: actions/checkout@v4.1.7 - with: - ref: ${{ inputs.GIT_TAG_TO_PUBLISH }} - - - run: git fetch --unshallow --prune - - - run: git status --long --verbose - - - uses: actions/setup-node@v4.0.3 - with: - always-auth: true - node-version: ${{ env.NODEJS_VERSION }} - registry-url: "https://registry.npmjs.org/" - scope: "@hyperledger" - - - run: cat /home/runner/work/_temp/.npmrc - - - name: ./tools/ci.sh - run: ./tools/ci.sh - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: false - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - - - name: Check npm whoami with --registry set to npmjs - continue-on-error: true - run: npm whoami --registry=https://registry.npmjs.org/ - - - name: lerna-publish-npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git config --global user.email "npm-ci@hyperledger.org" - git config --global user.name "hyperledger-ghci" - npm whoami - yarn lerna publish from-git --yes --loglevel=debug --ignore-scripts - - - run: cat /home/runner/work/_temp/.npmrc - - # Reset the .npmrc by deleting it. Invoking the setup-node action again below - # will set it up from scratch again but with a different registry configuration - # so that we can publish to both registries instead of having to choose. - - run: rm /home/runner/work/_temp/.npmrc - - - uses: actions/setup-node@v4.0.3 - with: - always-auth: true - node-version: ${{ env.NODEJS_VERSION }} - registry-url: "https://npm.pkg.github.com/" - scope: "@hyperledger" - - - run: cat /home/runner/work/_temp/.npmrc - - # Re-initialize the registries so that the @iroha2 scope gets configured in .npmrc - - run: yarn run init-registries - - - run: cat /home/runner/work/_temp/.npmrc - - - name: Check npm whoami with no --registry parameter. - continue-on-error: true - run: npm whoami - - - name: Check npm whoami with --registry set to GHCR - continue-on-error: true - run: npm whoami --registry=https://npm.pkg.github.com/ - - - name: Configure git user and email - run: | - git config --global user.email "npm-ci@hyperledger.org" - git config --global user.name "hyperledger-ghci" - - # We run the publish script a second time after having reconfigured the registry to be GHCR - # instead of npmjs.org so that we can publish the packages everywhere. - - name: lerna-publish-ghcr - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - yarn lerna publish from-git --yes --loglevel=debug --ignore-scripts diff --git a/.github/workflows/besu-all-in-one-publish.yaml b/.github/workflows/besu-all-in-one-publish.yaml deleted file mode 100644 index 2b2395025c2..00000000000 --- a/.github/workflows/besu-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: besu-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-besu-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/besu-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/besu-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/cacti-dev-container-vscode-publish.yaml b/.github/workflows/cacti-dev-container-vscode-publish.yaml deleted file mode 100644 index 735cd4ad2c2..00000000000 --- a/.github/workflows/cacti-dev-container-vscode-publish.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: connector-fabric-publish - -env: - NODEJS_VERSION: v20.3.0 - IMAGE_NAME: cacti-dev-container-vscode - -on: - push: - # Publish `v1.2.3` tags as releases. - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-fabric/ - permissions: - packages: write - contents: read - - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - uses: actions/checkout@v4.1.7 - - - name: npm_install_@devcontainers/cli@0.44.0 - run: npm install -g @devcontainers/cli@0.44.0 - - - name: npx_yes_devcontainers_cli_build - run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder="./" --log-level=trace --push=false --config="./.devcontainer/devcontainer.json" --image-name="$IMAGE_NAME" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 9ab5a975493..00000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,2290 +0,0 @@ -# Below are the full description for the shorten job names: -# -# ce - cactus-example -# cp - cactus-plugin -# cpk - cactus-plugin-keychain -# cpl - cactus-plugin-ledger -# cplc - cactus-plugin-ledger-connector -# plc - plugin-ledger-connector -# cpp - cactus-plugin-persistence -# ct - cactus-test -# ctp - cactus-test-plugin ---- -env: - NODEJS_VERSION: v18.18.2 - RUN_TRIVY_SCAN: true - RUN_CODE_COVERAGE: true -jobs: - ActionLint: - needs: check-ci-skip - uses: ./.github/workflows/actionlint.yaml - DCI-Lint: - name: DCI-Lint - needs: check-ci-skip - runs-on: ubuntu-22.04 - steps: - - id: lint-git-repo - name: Lint Git Repo - uses: petermetz/gh-action-dci-lint@v0.6.1 - with: - lint-git-repo-request: '{"cloneUrl": "${{ github.server_url }}/${{ github.repository }}.git", "fetchArgs": ["--update-head-ok", "--no-tags", "--prune", "--progress", "--no-recurse-submodules", "--depth=1", "origin" ,"+${{ github.sha }}:${{ github.ref }}"], "checkoutArgs": [ "${{ github.ref }}"], "targetPhrasePatterns": [], "configDefaultsUrl": "https://inclusivenaming.org/json/dci-lint-config-recommended-v1.json" }' - - name: Get the output response - run: echo "${{ steps.lint-git-repo.outputs.lint-git-repo-response }}" - - check-ci-skip: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: Check CI Skip - run: node tools/ci-skip-for-maintainers.js ${{ github.event.pull_request.url }} ${{ github.event.pull_request.user.login }} - - check-coverage: - needs: check-ci-skip - outputs: - run-coverage: ${{ steps.set-output.outputs.run-coverage }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: Set output - id: set-output - run: echo "run-coverage=${{ env.RUN_CODE_COVERAGE }}" >> "$GITHUB_OUTPUT" - - compute_changed_packages: - needs: check-ci-skip - outputs: - cmd-api-server-changed: ${{ steps.changes.outputs.cmd-api-server-changed }} - plugin-ledger-connector-polkadot-changed: ${{ steps.changes.outputs.plugin-ledger-connector-polkadot-changed }} - plugin-ledger-connector-aries-changed: ${{ steps.changes.outputs.plugin-ledger-connector-aries-changed }} - plugin-ledger-connector-besu-changed: ${{ steps.changes.outputs.plugin-ledger-connector-besu-changed }} - plugin-ledger-connector-corda-changed: ${{ steps.changes.outputs.plugin-ledger-connector-corda-changed }} - plugin-ledger-connector-fabric-changed: ${{ steps.changes.outputs.plugin-ledger-connector-fabric-changed }} - plugin-ledger-connector-ethereum-changed: ${{ steps.changes.outputs.plugin-ledger-connector-ethereum-changed }} - plugin-ledger-connector-iroha2-changed: ${{ steps.changes.outputs.plugin-ledger-connector-iroha2-changed }} - plugin-ledger-connector-stellar-changed: ${{ steps.changes.outputs.plugin-ledger-connector-stellar-changed }} - plugin-htlc-coordinator-besu-changed: ${{ steps.changes.outputs.plugin-htlc-coordinator-besu-changed }} - test-tooling-changed: ${{ steps.changes.outputs.test-tooling-changed }} - ghcr-dev-container-vscode-changed: ${{ steps.changes.outputs.ghcr-dev-container-vscode-changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - cmd-api-server-changed: - - './packages/cactus-cmd-api-server/**' - - './packages/cactus-test-cmd-api-server/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-vault/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-polkadot-changed: - - './packages/cactus-plugin-ledger-connector-polkadot/**!(*.md|*.css|*.html|*.jpg|*.jpeg|*.png)' - - './packages/cactus-common/**!(*.md|*.css|*.html|*.jpg|*.jpeg|*.png)' - - './packages/cactus-core/**!(*.md|*.css|*.html|*.jpg|*.jpeg|*.png)' - - './packages/cactus-core-api/**!(*.md|*.css|*.html|*.jpg|*.jpeg|*.png)' - - './packages/cactus-test-tooling/**!(*.md|*.css|*.html|*.jpg|*.jpeg|*.png)' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-aries-changed: - - './packages/cactus-plugin-ledger-connector-aries/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-besu-changed: - - './packages/cactus-plugin-ledger-connector-besu/**' - - './packages/cactus-test-plugin-ledger-connector-besu/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml'' - - plugin-ledger-connector-corda-changed: - - './packages/cactus-plugin-ledger-connector-corda/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-fabric-changed: - - './packages/cactus-plugin-ledger-connector-fabric/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-ethereum-changed: - - './packages/cactus-plugin-ledger-connector-ethereum/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-test-geth-ledger/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-iroha2-changed: - - './packages/cactus-plugin-ledger-connector-iroha2/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml' - - plugin-ledger-connector-stellar-changed: - - './packages/cacti-plugin-ledger-connector-stellar/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml' - - test-tooling-changed: - - './packages/cactus-test-tooling/**' - - './packages/cactus-common/**' - # - './.github/workflows/ci.yaml' - - ghcr-dev-container-vscode-changed: - - './.devcontainer/**' - - plugin-htlc-coordinator-besu-changed: - - './extensions/cactus-plugin-htlc-coordinator-besu/**' - - './packages/cactus-plugin-htlc-eth-besu/**' - - './packages/cactus-plugin-htlc-eth-besu-erc20/**' - - './packages/cactus-plugin-ledger-connector-besu/**' - - './packages/cactus-test-plugin-htlc-eth-besu-erc20/**' - - './packages/cactus-common/**' - - './packages/cactus-core/**' - - './packages/cactus-core-api/**' - - './packages/cactus-test-tooling/**' - - './packages/cactus-plugin-keychain-memory/**' - # - './.github/workflows/ci.yaml' - - build-dev: - needs: check-ci-skip - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - CHECK_WORK_TREE_STATUS_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Initialize Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - if : ${{ (steps.yarn-cache.outputs.cache-hit != 'true') }} - name: tools_ci_sh - run: ./tools/ci.sh - - yarn_lint: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - run: git status --porcelain - - run: git status --porcelain | wc -l - - run: yarn lint - - run: git status --porcelain - - run: git status --porcelain | wc -l - - - name: Set env.GIT_INDEX_FILE_COUNT - id: set_env_git_index_file_count - run: | - echo "GIT_INDEX_FILE_COUNT=$(git status --porcelain | wc -l)" >> "$GITHUB_ENV" - - - name: Print env.GIT_INDEX_FILE_COUNT - id: print_env_git_index_file_count - run: | - echo "${{ env.GIT_INDEX_FILE_COUNT }}" - - uses: actions/github-script@v7.0.1 - id: set-result-git_index_file_count - with: - script: | - const { GIT_INDEX_FILE_COUNT } = process.env; - console.log(`env.GIT_INDEX_FILE_COUNT ${GIT_INDEX_FILE_COUNT}`); - return parseInt(GIT_INDEX_FILE_COUNT, 10); - result-encoding: string - - - name: Get result Git Index File Count - id: get_result_git_index_file_count - run: echo "${{steps.set-result-git_index_file_count.outputs.result}}" - - - name: Check Lint Side-effects - if: ${{ steps.set-result-git_index_file_count.outputs.result != 0 }} - uses: actions/github-script@v7.0.1 - with: - script: | - const failMsg = "yarn lint script produced version control " + - "side-effects: source files have been changed by it that are " + - "otherwise are under version control. " + - "This means (99% of the time) that you need to run the " + - "yarn lint script locally and then include the changes it " + - "makes in your own commit when submitting your pull request."; - core.setFailed(failMsg) - - yarn_codegen: - continue-on-error: false - env: - DEV_BUILD_DISABLED: true - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - run: git status --porcelain - - run: git status --porcelain | wc -l - - run: yarn codegen - - run: git status --porcelain - - run: git status --porcelain | wc -l - - - name: Set env.GIT_INDEX_FILE_COUNT - id: set_env_git_index_file_count - run: | - echo "GIT_INDEX_FILE_COUNT=$(git status --porcelain | wc -l)" >> "$GITHUB_ENV" - - - name: Print env.GIT_INDEX_FILE_COUNT - id: print_env_git_index_file_count - run: | - echo "${{ env.GIT_INDEX_FILE_COUNT }}" - - - uses: actions/github-script@v7.0.1 - id: set-result-git_index_file_count - with: - script: | - const { GIT_INDEX_FILE_COUNT } = process.env; - console.log(`env.GIT_INDEX_FILE_COUNT ${GIT_INDEX_FILE_COUNT}`); - return parseInt(GIT_INDEX_FILE_COUNT, 10); - result-encoding: string - - - name: Get result Git Index File Count - id: get_result_git_index_file_count - run: echo "${{steps.set-result-git_index_file_count.outputs.result}}" - - - name: Check CodeGen Side-effects - if: ${{ steps.set-result-git_index_file_count.outputs.result != 0 }} - uses: actions/github-script@v7.0.1 - with: - script: | - const failMsg = "yarn codegen script produced version control " + - "side-effects: source files have been changed by it that are " + - "otherwise are under version control. " + - "This means (99% of the time) that you need to run the " + - "yarn codegen script locally and then include the changes it " + - "makes in your own commit when submitting your pull request."; - core.setFailed(failMsg) - - yarn_custom_checks: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: false - CONFIGURE_DISABLED: false - CACTI_CUSTOM_CHECKS_REQUIRED_OPENAPI_SPEC_VERSION: 3.0.3 - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - yarn_tools_validate_bundle_names: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: false - CUSTOM_CHECKS_DISABLED: true - CONFIGURE_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - cactus-api-client: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-api-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-api-client - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-1 - path: ./code-coverage-ts/**/ - - cactus-cmd-api-server: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.cmd-api-server-changed == 'true' - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-cmd-api-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-cmd-api-server - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/certificates-work-for-mutual-tls.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/config/self-signed-certificate-generator/generates-working-certificates.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-js-proto-loader-client-healthcheck.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/grpc-proto-gen-ts-client-m-tls-enabled.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-2 - path: ./code-coverage-ts/**/ - - - name: build_ncc_bundle - run: yarn lerna run build:bundle --scope=@hyperledger/cactus-cmd-api-server - - - name: ghcr.io/hyperledger/cactus-cmd-api-server - run: | - DOCKER_BUILDKIT=1 docker build \ - --file ./packages/cactus-cmd-api-server/cmd-api-server.Dockerfile \ - ./packages/cactus-cmd-api-server \ - --tag cas \ - --tag cmd-api-server \ - --tag "ghcr.io/hyperledger/cactus-cmd-api-server:$(date +"%Y-%m-%dT%H-%M-%S" --utc)-dev-$(git rev-parse --short HEAD)" - - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} - name: Run Trivy vulnerability scan for cmd-api-server - uses: aquasecurity/trivy-action@0.19.0 - with: - image-ref: 'cmd-api-server' - format: 'table' - exit-code: '1' - ignore-unfixed: false - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - trivyignores: ./.trivyignore - - - name: Ensure .tmp Directory Exists - run: mkdir -p .tmp/benchmark-results/cmd-api-server/ - - # Download previous benchmark result from cache (if exists) - - name: Download previous benchmark data - uses: actions/cache@v4.0.2 - with: - path: .tmp/benchmark-results/cmd-api-server/ - key: ${{ runner.os }}-benchmark - - - name: Run Benchmarks - working-directory: ./packages/cactus-cmd-api-server/ - run: yarn run benchmark - - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1.20.3 - with: - tool: 'benchmarkjs' - output-file-path: .tmp/benchmark-results/cmd-api-server/run-cmd-api-server-benchmark.ts.log - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Only push the benchmark results to gh-pages website if we are running on the main branch - # We do not want to clutter the benchmark results with intermediate results from PRs that could be drafts - auto-push: ${{ github.ref == 'refs/heads/main' }} - - # Show alert with commit comment on detecting possible performance regression - alert-threshold: '200%' - comment-on-alert: true - fail-on-alert: true - alert-comment-cc-users: '@hyperledger/cacti-maintainers' - - cactus-common-example-server: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-common-example-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-common-example-server - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-3 - path: ./code-coverage-ts/**/ - - cactus-common: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-common/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: './packages/cactus-common/src/test/typescript/unit/logging/logger.test.ts' - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-common - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-4 - path: ./code-coverage-ts/**/ - - cactus-core: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-core/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-core - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-5 - path: ./code-coverage-ts/**/ - - cactus-core-api: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-core-api/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-core-api - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-6 - path: ./code-coverage-ts/**/ - - ce-carbon-accounting-backend: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-backend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-carbon-accounting-backend - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: ./examples/cactus-example-carbon-accounting-backend/src/test/typescript/integration/admin-enroll-v1-endpoint.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-7 - path: ./code-coverage-ts/**/ - - ce-carbon-accounting-business-logic-plugin: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-business-logic-plugin/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-carbon-accounting-business-logic-plugin - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-8 - path: ./code-coverage-ts/**/ - - ce-carbon-accounting-frontend: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-carbon-accounting-frontend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-carbon-accounting-frontend - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-9 - path: ./code-coverage-ts/**/ - ce-supply-chain-backend: - continue-on-error: false - env: - DUMP_DISK_USAGE_INFO_DISABLED: false - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-backend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-supply-chain-backend - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: '--files={./examples/cactus-example-supply-chain-backend/src/test/typescript/integration/supply-chain-backend-api-calls.test.ts,./examples/cactus-example-supply-chain-backend/src/test/typescript/integration/supply-chain-cli-via-npm-script.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-10 - path: ./code-coverage-ts/**/ - - ce-supply-chain-business-logic-plugin: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-business-logic-plugin/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-supply-chain-business-logic-plugin - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-11 - path: ./code-coverage-ts/**/ - - ce-supply-chain-frontend: - continue-on-error: false - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: examples/cactus-example-supply-chain-frontend/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: true - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ce-supply-chain-frontend - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-12 - path: ./code-coverage-ts/**/ - - cp-consortium-manual: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-consortium-manual/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-consortium-manual - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-13 - path: ./code-coverage-ts/**/ - - cp-htlc-coordinator-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-htlc-coordinator-besu - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/counterparty-htlc-endpoint.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/own-htlc-endpoint.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/refund.test.ts,./extensions/cactus-plugin-htlc-coordinator-besu/src/test/typescript/integration/plugin-htlc-coordinator/withdraw-counterparty-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-14 - path: ./code-coverage-ts/**/ - - cp-htlc-eth-besu: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-htlc-eth-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-htlc-eth-besu - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-15 - path: ./code-coverage-ts/**/ - - cp-htlc-eth-besu-erc20: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-htlc-eth-besu-erc20/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-htlc-eth-besu-erc20 - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-16 - path: ./code-coverage-ts/**/ - - cp-keychain-aws-sm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-aws-sm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts,./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts}' - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-keychain-aws-sm - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-17 - path: ./code-coverage-ts/**/ - - cp-keychain-azure-kv: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-azure-kv/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-keychain-azure-kv - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: ./packages/cactus-plugin-keychain-azure-kv/src/test/typescript/integration/plugin-keychain-azure-kv.test.ts - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-18 - path: ./code-coverage-ts/**/ - - cpk-google-sm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-google-sm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpk-google-sm - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-19 - path: ./code-coverage-ts/**/ - cpk-memory: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-memory/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpk-memory - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-20 - path: ./code-coverage-ts/**/ - cpk-memory-wasm: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-memory-wasm/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpk-memory-wasm - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: ./packages/cactus-plugin-keychain-memory-wasm/src/test/typescript/unit/plugin-keychain-memory-wasm.test.ts - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-21 - path: ./code-coverage-ts/**/ - cpk-vault: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-keychain-vault/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpk-vault - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/cactus-keychain-vault-server.test.ts,./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-keychain-vault/src/test/typescript/integration/plugin-keychain-vault.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-22 - path: ./code-coverage-ts/**/ - cpl-connector-aries: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-aries-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-aries/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpl-connector-aries - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-23 - path: ./code-coverage-ts/**/ - cpl-connector-besu: - permissions: write-all - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-besu-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpl-connector-besu - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-web3-eea.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/v21-get-record-locator.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-24 - path: ./code-coverage-ts/**/ - - - name: Ensure .tmp Directory Exists - run: mkdir -p .tmp/benchmark-results/plugin-ledger-connector-besu/ - - # Download previous benchmark result from cache (if exists) - - name: Download previous benchmark data - uses: actions/cache@v4.0.2 - with: - path: .tmp/benchmark-results/plugin-ledger-connector-besu/ - key: ${{ runner.os }}-benchmark - - - name: Run Benchmarks - working-directory: ./packages/cactus-plugin-ledger-connector-besu/ - run: yarn run benchmark - - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1.20.3 - with: - tool: 'benchmarkjs' - output-file-path: .tmp/benchmark-results/plugin-ledger-connector-besu/run-plugin-ledger-connector-besu-benchmark.ts.log - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Only push the benchmark results to gh-pages website if we are running on the main branch - # We do not want to clutter the benchmark results with intermediate results from PRs that could be drafts - auto-push: ${{ github.ref == 'refs/heads/main' }} - - # Show alert with commit comment on detecting possible performance regression - alert-threshold: '200%' - comment-on-alert: true - fail-on-alert: true - alert-comment-cc-users: '@hyperledger/cacti-maintainers' - - cpl-connector-polkadot: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-polkadot/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpl-connector-polkadot - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-polkadot-changed == 'true' - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-25 - path: ./code-coverage-ts/**/ - cpl-connector-corda: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-corda-changed == 'true' - env: - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-corda/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpl-connector-corda - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/flow-database-access-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/openapi/openapi-validation.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - - run: ./tools/ci.sh - - - name: Upload coverage reports as artifacts - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-26 - path: ./code-coverage-ts/**/ - - - name: build cacti-connector-corda-server-dev.jar - working-directory: packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/ - run: ./gradlew clean build -Pversion=dev -DrootProjectName=cacti-connector-corda-server - - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} - name: Run Trivy vulnerability scan for cactus-connector-corda-server - uses: aquasecurity/trivy-action@0.19.0 - with: - scan-type: 'rootfs' - scan-ref: 'packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/build/libs/cacti-connector-corda-server-dev.jar' - format: 'table' - exit-code: '1' - ignore-unfixed: false - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - - cpl-connector-stellar: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-stellar-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cacti-plugin-ledger-connector-stellar/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_RUNNER_DISABLED: true - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpl-connector-stellar - JEST_TEST_CODE_COVERAGE_ENABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-27 - path: ./code-coverage-ts/**/ - - plc-fabric-0: - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-fabric-changed == 'true' - continue-on-error: false - env: - CACTI_NPM_PACKAGE_NAME: "@hyperledger/cactus-plugin-ledger-connector-fabric" - HFC_LOGGING: '' - FULL_BUILD_DISABLED: true - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/plc-fabric-0 - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-28 - path: ./code-coverage-ts/**/ - - cplc-iroha2: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-iroha2-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-iroha2/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-iroha2 - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-30 - path: ./code-coverage-ts/**/ - cplc-ethereum: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-ethereum-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-ethereum - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-31 - path: ./code-coverage-ts/**/ - cplc-sawtooth: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-sawtooth/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-sawtooth - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-32 - path: ./code-coverage-ts/**/ - cplc-xdai: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-xdai - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/deploy-contract-from-json-xdai-json-object.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/invoke-contract-xdai-json-object.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/openapi/openapi-validation-no-keychain.test.ts,./packages/cactus-plugin-ledger-connector-xdai/src/test/typescript/integration/openapi/openapi-validation.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-33 - path: ./code-coverage-ts/**/ - cpp-ethereum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-persistence-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpp-ethereum - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-34 - path: ./code-coverage-ts/**/ - cpp-fabric: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-plugin-persistence-fabric/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpp-fabric - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-cpp-fabric - path: ./code-coverage-ts/**/ - cp-object-store-ipfs: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: extensions/cactus-plugin-object-store-ipfs/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-object-store-ipfs - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: '--files={./extensions/cactus-plugin-object-store-ipfs/src/test/typescript/integration/plugin-object-store-ipfs.test.ts,./extensions/cactus-plugin-object-store-ipfs/src/test/typescript/unit/plugin-object-store-ipfs.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-35 - path: ./code-coverage-ts/**/ - # cactus-plugin-satp-hermes: - # continue-on-error: false - # env: - # FULL_BUILD_DISABLED: true - # JEST_TEST_PATTERN: packages/cactus-plugin-satp-hermes/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - # JEST_TEST_RUNNER_DISABLED: false - # TAPE_TEST_RUNNER_DISABLED: true - # needs: build-dev - # runs-on: ubuntu-22.04 - # steps: - # - name: Use Node.js ${{ env.NODEJS_VERSION }} - # uses: actions/setup-node@v4.0.3 - # with: - # node-version: ${{ env.NODEJS_VERSION }} - # - uses: actions/checkout@v4.1.7 - # - id: yarn-cache-dir-path - # name: Get yarn cache directory path - # run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT" - # - id: yarn-cache - # name: Restore Yarn Cache - # uses: actions/cache@v4.0.2 - # with: - # key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - # path: ./.yarn/ - # restore-keys: | - # ${{ runner.os }}-yarn- - # - run: ./tools/ci.sh - cp-bungee-hermes: - continue-on-error: false - env: - # Otherwise it fails with: You are running out of disk space. - # The runner will stop working when the machine runs out of disk space. - # Free space left: 26 MB - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_PATTERN: packages/cactus-plugin-bungee-hermes/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-bungee-hermes - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-36 - path: ./code-coverage-ts/**/ - ct-api-client: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-api-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ct-api-client - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-37 - path: ./code-coverage-ts/**/ - ct-cmd-api-server: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.cmd-api-server-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-cmd-api-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ct-cmd-api-server - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-38 - path: ./code-coverage-ts/**/ - ct-geth-ledger: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-geth-ledger/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ct-geth-ledger - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-39 - path: ./code-coverage-ts/**/ - ctp-consortium-manual: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-consortium-manual/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - TAPE_TEST_PATTERN: ./packages/cactus-test-plugin-consortium-manual/src/test/typescript/integration/plugin-consortium-manual/openapi/openapi-validation.test.ts - TAPE_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cpt-consortium-manual - JEST_TEST_CODE_COVERAGE_ENABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-40 - path: ./code-coverage-ts/**/ - ctp-htlc-eth-besu: - continue-on-error: false - env: - ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-htlc-eth-besu - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: '--files={./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/get-single-status-endpoint.test.ts,./packages/cactus-test-plugin-htlc-eth-besu/src/test/typescript/integration/plugin-htlc-eth-besu/openapi/openapi-validation.test.ts}' - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-41 - path: ./code-coverage-ts/**/ - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run solidity tests - run: cd packages/cactus-plugin-htlc-eth-besu && forge test -vvvvv - - ctp-htlc-eth-besu-erc20: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-htlc-eth-besu-erc20 - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/get-status-endpoint.test.ts,./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/openapi/openapi-validation.test.ts,./packages/cactus-test-plugin-htlc-eth-besu-erc20/src/test/typescript/integration/plugin-htlc-eth-besu-erc20/refund-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-42 - path: ./code-coverage-ts/**/ - ctp-ledger-connector-besu: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-besu-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-ledger-connector-besu - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-block-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-past-logs-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/get-transaction-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-block-endpoint.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-43 - path: ./code-coverage-ts/**/ - ctp-ledger-connector-ethereum: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-ethereum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-ledger-connector-ethereum - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-44 - path: ./code-coverage-ts/**/ - cactus-test-tooling: - continue-on-error: false - needs: - - build-dev - - compute_changed_packages - if: needs.compute_changed_packages.outputs.test-tooling-changed == 'true' - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-test-tooling/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-test-tooling - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_PATTERN: >- - --files={./packages/cactus-test-tooling/src/test/typescript/integration/besu/besu-test-ledger/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/fabric/fabric-test-ledger-v1/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/substrate/substrate-test-ledger-constructor.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/substrate/substrate-test-ledger-multiple-concurrent.test.ts} - TAPE_TEST_RUNNER_DISABLED: false - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-45 - path: ./code-coverage-ts/**/ - cactus-verifier-client: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_PATTERN: packages/cactus-verifier-client/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-verifier-client - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-46 - path: ./code-coverage-ts/**/ - cp-consortium-static: - continue-on-error: false - env: - FULL_BUILD_DISABLED: true - JEST_TEST_RUNNER_DISABLED: false - JEST_TEST_PATTERN: packages/cacti-plugin-consortium-static/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts - JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-consortium-static - JEST_TEST_CODE_COVERAGE_ENABLED: true - TAPE_TEST_RUNNER_DISABLED: true - needs: build-dev - runs-on: ubuntu-22.04 - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - - id: yarn-cache - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - path: ./.yarn/ - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - - run: ./tools/ci.sh - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} - - name: Upload coverage reports as artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: coverage-reports-47 - path: ./code-coverage-ts/**/ - ghcr-besu-all-in-one: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-besu-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/besu-all-in-one/ -f ./tools/docker/besu-all-in-one/Dockerfile - ghcr-connector-corda-server: - runs-on: ubuntu-22.04 - needs: - - compute_changed_packages - if: needs.compute_changed_packages.outputs.plugin-ledger-connector-corda-changed == 'true' - - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-connector-corda-server - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-ledger-connector-corda/src/main-server/ -f ./packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile -t cactus-connector-corda-server - - ghcr-corda-all-in-one-flowdb: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-corda-all-in-one-flowdb - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/corda-all-in-one/corda-v4_8-flowdb/ - - ghcr-dev-container-vscode: - runs-on: ubuntu-22.04 - needs: - - compute_changed_packages - if: needs.compute_changed_packages.outputs.ghcr-dev-container-vscode-changed == 'true' - env: - IMAGE_NAME: cacti-dev-container-vscode - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - name: npm_install_@devcontainers/cli@0.44.0 - run: npm install -g @devcontainers/cli@0.44.0 - - name: npx_yes_devcontainers_cli_build - run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder="./" --log-level=trace --push=false --config="./.devcontainer/devcontainer.json" --image-name="$IMAGE_NAME" - ghcr-example-carbon-accounting: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-example-carbon-accounting - run: DOCKER_BUILDKIT=1 docker build . -f ./examples/carbon-accounting/Dockerfile - - ghcr-example-supply-chain-app: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-example-supply-chain-app - run: DOCKER_BUILDKIT=1 docker build . -f ./examples/cactus-example-supply-chain-backend/Dockerfile -t cactus-example-supply-chain-app - - ghcr-fabric2-all-in-one: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-fabric2-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/fabric-all-in-one/ -f ./tools/docker/fabric-all-in-one/Dockerfile_v2.x - - ghcr-daml-all-in-one: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.1 - - name: ghcr.io/hyperledger/daml-all-in-one - run: DOCKER_BUILDKIT=1 docker build ./tools/docker/daml-all-in-one/ -f ./tools/docker/daml-all-in-one/Dockerfile - - ghcr-keychain-vault-server: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - name: ghcr.io/hyperledger/cactus-keychain-vault-server - run: DOCKER_BUILDKIT=1 docker build ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/ -f ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/Dockerfile -t cactus-keychain-vault-server - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} - name: Run Trivy vulnerability scan for cactus-keychain-vault-server - uses: aquasecurity/trivy-action@0.19.0 - with: - image-ref: 'cactus-keychain-vault-server' - format: 'table' - exit-code: '1' - ignore-unfixed: false - vuln-type: 'os,library' - severity: 'CRITICAL,HIGH' - -name: Cactus_CI -'on': - pull_request: - branches: - - main - - dev - - petermetz/** - push: - branches: - - main - - dev \ No newline at end of file diff --git a/.github/workflows/ci_weaver.yaml b/.github/workflows/ci_weaver.yaml deleted file mode 100644 index 5dba3cc52b3..00000000000 --- a/.github/workflows/ci_weaver.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: Weaver_CI - -# Controls when the workflow will run -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - schedule: - # run at 1am the first day of every month - - cron: "0 1 1 * *" - -env: - RUN_ALL: "${{github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}" - -jobs: - - fabric-fabric-satp: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-fabric-fabric-satp.yaml - asset-exchange-corda: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-asset-exchange-corda.yaml - asset-transfer: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-asset-transfer.yaml - relay: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-relay.yaml - corda-interop-app: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-corda-interop-app.yaml - pre-release: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-pre-release.yaml - asset-exchange-fabric: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-asset-exchange-fabric.yaml - data-sharing: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-data-sharing.yaml - node-pkgs: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-node-pkgs.yaml - docker-build: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-docker-build.yaml - asset-exchange-besu: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-asset-exchange-besu.yaml - go: - with: - run_all: $RUN_ALL - uses: ./.github/workflows/test_weaver-go.yaml - diff --git a/.github/workflows/cmd-api-server-publish.yaml b/.github/workflows/cmd-api-server-publish.yaml deleted file mode 100644 index 04efda762ca..00000000000 --- a/.github/workflows/cmd-api-server-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: cmd-api-server-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-cmd-api-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-cmd-api-server/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index ba3b13bc27c..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - # The branches below must be a subset of the branches above - branches: [main] - schedule: - - cron: '0 11 * * 1' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['typescript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v4.1.7 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/commitlint-pull-request.yaml b/.github/workflows/commitlint-pull-request.yaml deleted file mode 100644 index 40d17ed0af5..00000000000 --- a/.github/workflows/commitlint-pull-request.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Commit Lint" -on: [pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - commitlint: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v5.4.1 diff --git a/.github/workflows/connector-besu-publish.yaml b/.github/workflows/connector-besu-publish.yaml deleted file mode 100644 index 691cc2a4ff5..00000000000 --- a/.github/workflows/connector-besu-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: connector-fabric-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-fabric - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-fabric/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-fabric/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/connector-corda-server-publish.yaml b/.github/workflows/connector-corda-server-publish.yaml deleted file mode 100644 index 7534ff9618d..00000000000 --- a/.github/workflows/connector-corda-server-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: connector-corda-server-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-corda-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-corda/src/main-server/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-corda/src/main-server/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/connector-fabric-publish.yaml b/.github/workflows/connector-fabric-publish.yaml deleted file mode 100644 index 7b2c93a3876..00000000000 --- a/.github/workflows/connector-fabric-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: connector-besu-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-connector-besu - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-ledger-connector-besu/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-ledger-connector-besu/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/coverage_ts.yaml b/.github/workflows/coverage_ts.yaml deleted file mode 100644 index afd832afe34..00000000000 --- a/.github/workflows/coverage_ts.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- - name: coverage_typescript - - env: - NODEJS_VERSION: v18.18.2 - on: - workflow_run: - workflows: - - Cactus_CI - types: - - completed - - jobs: - generate_coverage_report: - runs-on: ubuntu-22.04 - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - name: Check out repository - uses: actions/checkout@v4.1.7 - - - name: Set up Node.js - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Restore Yarn Cache - uses: actions/cache@v4.0.2 - with: - path: ./.yarn/ - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies and istanbul-merge - run: | - yarn install - yarn add istanbul-merge --dev - - - name: Download coverage reports - uses: actions/download-artifact@v4.1.8 - with: - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} - path: ./code-coverage-ts/ - - - name: Merge and generate coverage reports - run: | - ls -R ./code-coverage-ts/**/**/ - npx istanbul-merge --out coverage.json ./code-coverage-ts/coverage-reports-*/*/coverage-final.json - npx istanbul report --include coverage.json --dir cacti html - npx istanbul report --include coverage.json --dir cacti text - npx istanbul report --include coverage.json --dir cacti text-summary - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 - with: - name: code-coverage-report - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/daml-all-in-one-publish.yaml b/.github/workflows/daml-all-in-one-publish.yaml deleted file mode 100644 index 991b0fc78f3..00000000000 --- a/.github/workflows/daml-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: daml-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cacti-daml-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/daml-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/daml-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.1 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/dco.yaml b/.github/workflows/dco.yaml deleted file mode 100644 index ec9ecdd8184..00000000000 --- a/.github/workflows/dco.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: DCO - -on: [pull_request] - -jobs: - dco_check: - runs-on: ubuntu-22.04 - name: DCO - if: ${{ github.actor != 'dependabot[bot]' }} - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@198af03565609bb4ed924d1260247b4881f09e7d - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@f2279e6e62d5a7d9115b0cb8e837b777b1b02e21 - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} \ No newline at end of file diff --git a/.github/workflows/dependent-issues.yaml b/.github/workflows/dependent-issues.yaml deleted file mode 100644 index d9c588515a4..00000000000 --- a/.github/workflows/dependent-issues.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Dependent Issues - -on: - issues: - types: - - opened - - edited - - reopened - pull_request_target: - types: - - opened - - edited - - reopened - - synchronize - schedule: - - cron: '0 0 * * *' # schedule daily check - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check: - runs-on: ubuntu-22.04 - name: Dependent Issues - steps: - - uses: z0al/dependent-issues@v1 - env: - # (Required) The token to use to make API calls to GitHub. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # (Optional) The label to use to mark dependent issues - label: dependent - - # (Optional) Enable checking for dependencies in issues. Enable by - # setting the value to "on". Default "off" - check_issues: off - - # (Optional) A comma-separated list of keywords. Default - # "depends on, blocked by" - keywords: depends on, blocked by diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml deleted file mode 100644 index 4543392b92d..00000000000 --- a/.github/workflows/deploy_docs.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Docs (Github Pages) - -on: - push: - branches: - - main - - paths: - - 'docs/**' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - SITE_URL: https://${{ github.repository_owner }}.github.io/cacti - NODEJS_VERSION: v18.18.2 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - -jobs: - deploy-docs: - runs-on: ubuntu-22.04 - permissions: - contents: write - pages: write - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Python 3.x - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' # caching pip dependencies - - - name: Install dependencies - run: pip install -r requirements.txt - working-directory: docs - - - name: Build packages - run: npm run configure - - - name: Build markdown for openapi specs - run: 'python3 docs/scripts/publish_openapi.py' - - - name: Build and publish - run: git pull && mkdocs gh-deploy - working-directory: docs diff --git a/.github/workflows/dev-container-vscode-publish.yaml b/.github/workflows/dev-container-vscode-publish.yaml deleted file mode 100644 index 763fd91d446..00000000000 --- a/.github/workflows/dev-container-vscode-publish.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: dev-container-vscode-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-dev-container-vscode - NODEJS_VERSION: v18.18.2 - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./.devcontainer/Dockerfile - DOCKER_BUILD_DIR: ./.devcontainer/ - permissions: - packages: write - contents: read - - steps: - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - uses: actions/checkout@v4.1.7 - - name: npm_install_@devcontainers/cli@0.44.0 - run: npm install -g @devcontainers/cli@0.44.0 - - name: npx_yes_devcontainers_cli_build - run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder="./" --log-level=trace --push=false --config="./.devcontainer/devcontainer.json" --image-name="$IMAGE_NAME" - - name: Log in to registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/example-carbon-accounting-publish.yaml b/.github/workflows/example-carbon-accounting-publish.yaml deleted file mode 100644 index 16eaceadf40..00000000000 --- a/.github/workflows/example-carbon-accounting-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: example-carbon-accounting-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-example-carbon-accounting - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./examples/carbon-accounting/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/example-supply-chain-app-publish.yaml b/.github/workflows/example-supply-chain-app-publish.yaml deleted file mode 100644 index 8d3b7f6f283..00000000000 --- a/.github/workflows/example-supply-chain-app-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: example-supply-chain-app-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-example-supply-chain-app - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./examples/cactus-example-supply-chain-backend/Dockerfile - DOCKER_BUILD_DIR: ./ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/fabric2-all-in-one-publish.yaml b/.github/workflows/fabric2-all-in-one-publish.yaml deleted file mode 100644 index eccec659453..00000000000 --- a/.github/workflows/fabric2-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: fabric2-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-fabric2-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/fabric-all-in-one/Dockerfile_v2.x - DOCKER_BUILD_DIR: ./tools/docker/fabric-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/geth-all-in-one-publish.yaml b/.github/workflows/geth-all-in-one-publish.yaml deleted file mode 100644 index 55c54fc5702..00000000000 --- a/.github/workflows/geth-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: geth-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-geth-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/geth-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/geth-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/gg-shield-action.yaml b/.github/workflows/gg-shield-action.yaml deleted file mode 100644 index 0638236d5a8..00000000000 --- a/.github/workflows/gg-shield-action.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: GitGuardian scan - -on: - push: - # Publish `main` as Docker `latest` image. - branches: - - main - - # Publish `v1.2.3` tags as releases. - tags: - - v* - pull_request: - branches: - - main - -jobs: - scanning: - name: GitGuardian scan - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 0 # fetch all history so multiple commits can be scanned - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: GitGuardian scan - uses: GitGuardian/ggshield-action@v1.14.4 - with: - args: --show-secrets --exit-zero --all-policies --verbose - env: - GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} - GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} - GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} - GITHUB_DEFAULT_BRANCH: main - GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml b/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml deleted file mode 100644 index 2a9919f4352..00000000000 --- a/.github/workflows/ghpkg-all-kotlin-api-clients-publish.yaml +++ /dev/null @@ -1,263 +0,0 @@ -name: ghpkg-all-kotlin-api-clients-publish - -env: - NODEJS_VERSION: v18.18.2 - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - publish: - runs-on: ubuntu-22.04 - steps: - - name: Install Indy SDK - run: > - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 \ - && sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic stable" \ - && sudo apt-get update \ - && sudo apt-get install -y \ - libindy \ - libnullpay \ - libvcx \ - indy-cli \ - && sudo rm -f /etc/apt/sources.list.d/sovrin.list* - - - name: Checkout - uses: actions/checkout@v4.1.7 - with: - fetch-depth: 0 - - - name: Get the latest release version - run: | - GITVERSION="$(git describe --tags | awk -F'.' '{print $$1}')" - export GITVERSION - echo "GITVERSION=$GITVERSION" >> "$GITHUB_ENV" - - - uses: actions/setup-java@v3.11.0 - with: - distribution: 'adopt' - java-version: '8' - - - name: Set up NodeJS ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - run: npm run configure - - - name: build-cactus-plugin-ledger-connector-corda-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-ledger-connector-corda-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-ledger-connector-corda-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-ledger-connector-corda/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-cmd-api-server-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-cmd-api-server-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-cmd-api-server-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-core-api-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-core-api-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-core-api-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-core-api/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-consortium-manual-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-consortium-manual-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-consortium-manual-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-consortium-manual/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-google-sm-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-google-sm-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-google-sm-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-google-sm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-aws-sm-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-aws-sm-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-aws-sm-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-aws-sm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-azure-kv-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-azure-kv-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-azure-kv-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-azure-kv/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-memory-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-memory-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-memory-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-memory/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-vault-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-vault-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-vault-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-vault/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-ledger-connector-fabric-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-ledger-connector-fabric/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-ledger-connector-fabric-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-ledger-connector-fabric-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-ledger-connector-fabric/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-keychain-memory-wasm-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-keychain-memory-wasm-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-keychain-memory-wasm-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-keychain-memory-wasm/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-satp-hermes-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/packages/cactus-plugin-satp-hermes/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-satp-hermes-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-satp-hermes-kotlin-client-${{ env.GITVERSION }}.jar - path: packages/cactus-plugin-satp-hermes/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-example-supply-chain-business-logic-plugin-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-example-supply-chain-business-logic-plugin-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-example-supply-chain-business-logic-plugin-kotlin-client-${{ env.GITVERSION }}.jar - path: examples/cactus-example-supply-chain-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-example-carbon-accounting-business-logic-plugin-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-example-carbon-accounting-business-logic-plugin-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-example-carbon-accounting-business-logic-plugin-kotlin-client-${{ env.GITVERSION }}.jar - path: examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar - - - name: build-cactus-plugin-object-store-ipfs-kotlin-client - run: | - WDIR=$(pwd) - cd "${WDIR}/extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client" - chmod +x gradlew - ./gradlew clean - ./gradlew build - - - name: publish-cactus-plugin-object-store-ipfs-kotlin-client - uses: actions/upload-artifact@v3.0.0 - with: - name: cactus-plugin-object-store-ipfs-kotlin-client-${{ env.GITVERSION }}.jar - path: extensions/cactus-plugin-object-store-ipfs/src/main/kotlin/generated/openapi/kotlin-client/build/libs/kotlin-client-1.0.0.jar \ No newline at end of file diff --git a/.github/workflows/iroha2-all-in-one-publish.yaml b/.github/workflows/iroha2-all-in-one-publish.yaml deleted file mode 100644 index 656cc5c5332..00000000000 --- a/.github/workflows/iroha2-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: iroha2-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-iroha2-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/iroha2-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/iroha2-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/keychain-vault-server-publish.yaml b/.github/workflows/keychain-vault-server-publish.yaml deleted file mode 100644 index 37a4641530f..00000000000 --- a/.github/workflows/keychain-vault-server-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: keychain-vault-server-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-keychain-vault-server - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/Dockerfile - DOCKER_BUILD_DIR: ./packages/cactus-plugin-keychain-vault/src/cactus-keychain-vault-server/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/pr-commit-parity.yaml b/.github/workflows/pr-commit-parity.yaml deleted file mode 100644 index 8c4dfd73a84..00000000000 --- a/.github/workflows/pr-commit-parity.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: PR - Commit Parity -on: [pull_request] - -jobs: - pr-commit-parity: - name: PR and Commit messages Parity - runs-on: ubuntu-22.04 - if: "!contains('dependabot[bot]', github.event.pull_request.user.login)" - env: - ACCEPTABLE_SIMILARITY_RATIO: 0.9 - steps: - - uses: actions/checkout@v3.1.0 - - name: Execute pr-commit-parity script - run: node tools/pr-commit-parity.js ${{ github.event.pull_request.url }} "$ACCEPTABLE_SIMILARITY_RATIO" diff --git a/.github/workflows/publish-npm.yaml b/.github/workflows/publish-npm.yaml deleted file mode 100644 index 145abd651b2..00000000000 --- a/.github/workflows/publish-npm.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: publish-npm-manually - -env: - NODEJS_VERSION: v18.18.2 - -on: - workflow_dispatch: - inputs: - tag-pub: - type: string - description: Tag to publish - required: true - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - - build-and-publish-packages: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - with: - ref: ${{ inputs.tag-pub }} - - run: git fetch --unshallow --prune - - uses: actions/setup-node@v4.0.3 - with: - always-auth: true - node-version: ${{ env.NODEJS_VERSION }} - registry-url: 'https://registry.npmjs.org' - - name: ./tools/ci.sh - run: ./tools/ci.sh - env: - DEV_BUILD_DISABLED: false - FULL_BUILD_DISABLED: false - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - - name: lerna-publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - git config --global user.email "npm-ci@hyperledger.org" - git config --global user.name "hyperledger-ghci" - npm whoami - yarn lerna publish from-git --yes --loglevel=debug diff --git a/.github/workflows/sawtooth-all-in-one-publish.yaml b/.github/workflows/sawtooth-all-in-one-publish.yaml deleted file mode 100644 index 5434e652c45..00000000000 --- a/.github/workflows/sawtooth-all-in-one-publish.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: sawtooth-all-in-one-publish - -on: - # Publish `v1.2.3` tags as releases. - push: - tags: - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - IMAGE_NAME: cactus-sawtooth-all-in-one - -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - build-tag-push-container: - runs-on: ubuntu-22.04 - env: - DOCKER_BUILDKIT: 1 - DOCKERFILE_PATH: ./tools/docker/sawtooth-all-in-one/Dockerfile - DOCKER_BUILD_DIR: ./tools/docker/sawtooth-all-in-one/ - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - - name: Push image - run: | - SHORTHASH=$(git rev-parse --short "$GITHUB_SHA") - TODAYS_DATE="$(date +%F)" - DOCKER_TAG="$TODAYS_DATE-$SHORTHASH" - IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME" - # Change all uppercase to lowercase - IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]') - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/*" ]] && VERSION="${VERSION//^v//}" - # Do not use the `latest` tag at all, tag with date + git short hash if there is no git tag - [ "$VERSION" == "main" ] && VERSION=$DOCKER_TAG - echo IMAGE_ID="$IMAGE_ID" - echo VERSION="$VERSION" - docker tag "$IMAGE_NAME" "$IMAGE_ID:$VERSION" - docker push "$IMAGE_ID:$VERSION" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml deleted file mode 100644 index f208c190557..00000000000 --- a/.github/workflows/scorecard.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright the Hyperledger Cacti contributors. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -# This workflow uses actions that are not certified by GitHub. They are provided -# by a third-party and are governed by separate terms of service, privacy -# policy, and support documentation. - -name: OpenSSF Scorecard -on: - # For Branch-Protection check. Only the default branch is supported. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection - branch_protection_rule: - # To guarantee Maintained check is occasionally updated. See - # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained - schedule: - - cron: '30 2 * * 6' - push: - branches: [ "main" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecard analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Needed to publish results and get a badge (see publish_results below). - id-token: write - # Uncomment the permissions below if installing in a private repository. - # contents: read - # actions: read - - steps: - - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 - with: - results_file: results.sarif - results_format: sarif - # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: - # - you want to enable the Branch-Protection check on a *public* repository, or - # - you are installing Scorecard on a *private* repository - # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. - # repo_token: ${{ secrets.SCORECARD_TOKEN }} - - # Public repositories: - # - Publish results to OpenSSF REST API for easy access by consumers - # - Allows the repository to include the Scorecard badge. - # - See https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories: - # - `publish_results` will always be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard (optional). - # Commenting out will disable upload of results to your repo's Code Scanning dashboard - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 - with: - sarif_file: results.sarif - diff --git a/.github/workflows/semantic-pull-request.yaml b/.github/workflows/semantic-pull-request.yaml deleted file mode 100644 index 11f50949175..00000000000 --- a/.github/workflows/semantic-pull-request.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Lint PR" - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - main: - name: Validate PR title - runs-on: ubuntu-22.04 - steps: - - uses: amannn/action-semantic-pull-request@v5.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test_weaver-asset-exchange-besu.yaml b/.github/workflows/test_weaver-asset-exchange-besu.yaml deleted file mode 100644 index a83274dce21..00000000000 --- a/.github/workflows/test_weaver-asset-exchange-besu.yaml +++ /dev/null @@ -1,412 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Besu - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: asset-exchange-besu-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-asset-exchange-besu.yaml' - - asset-exchange-besu: - needs: check_code_changed - if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - app_contract: ["AliceERC1155", "AliceERC20", "AliceERC721"] - exclude: - - app_contract: ${{ needs.check_code_changed.outputs.status != 'true' }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 11 - uses: actions/setup-java@v3.11.0 - with: - java-version: '11' - distribution: 'adopt' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - # PROTOS - - name: Build Solidity Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-sol - - # BESU NETWORK - - name: Start Besu Network - run: | - sudo apt install -y tmux jq - wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.7.0/besu-22.7.0.zip - unzip besu-22.7.0.zip - export PATH="${PWD}/besu-22.7.0/bin:$PATH" - wget https://artifacts.consensys.net/public/ethsigner/raw/names/ethsigner.zip/versions/22.1.3/ethsigner-22.1.3.zip - unzip ethsigner-22.1.3.zip - export PATH="${PWD}/ethsigner-22.1.3/bin:$PATH" - make start - sleep 100 - working-directory: weaver/tests/network-setups/besu - - # Deploy contracts - - name: Deploy contracts - run: | - make deploy-contracts - working-directory: weaver/samples/besu/simpleasset - - # BESU CLI - - name: Setup BESU CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/besu/besu-cli - - - name: Setup BESU CLI init - run: | - make build - cp config.template.json tmp.json - cp config.template.json tmp.json - jq -r '.network1.tokenContract |= "../simpleasset/build/contracts/${{ matrix.app_contract }}.json"' tmp.json > config.json - cp config.json tmp.json - jq -r '.network2.tokenContract |= "../simpleasset/build/contracts/BobERC20.json"' tmp.json > config.json - rm tmp.json - working-directory: weaver/samples/besu/besu-cli - - - name: Asset Exchange Besu CLI Tests - run: | - export PATH="${PWD}/bin:$PATH" - COUNT=0 - TOTAL=10 - - # HTLC Params - timeout=1000 - hashBase64="ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs=" - preimage="secrettext" - - # issue tokens to account 1 - initAmount=10 - transferAmount=5 - tokenId=0 - # & lock 5 token for account 2 in network 1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --asset_type=ERC20 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount} " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - # Is Asset locked - besu-cli asset is-locked --network=network1 --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "in Network network1: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - besu-cli asset claim --network=network1 --recipient_account=2 --preimage=${preimage} --token_id=${tokenId} --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "Account balance of the recipient in Network network1 before claiming: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1 after claiming: ${transferAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ###### test unlock ####### - timeout=20 - initAmount=5 - recipientAmt=0 - transferAmount=2 - tokenId=1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - recipientAmt=5 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - recipientAmt=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: ${recipientAmt}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - sleep $timeout - - besu-cli asset unlock --network=network1 --lock_contract_id=$LOCK_ID --sender_account=1 --token_id=${tokenId} 1> tmp.out - cat tmp.out | grep "before unlocking: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "after unlocking: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/besu/besu-cli - - asset-exchange-besu-local: - needs: check_code_changed - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - app_contract: ["AliceERC1155", "AliceERC20", "AliceERC721"] - exclude: - - app_contract: ${{ needs.check_code_changed.outputs.status != 'true' }} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Print needs.check_code_changed.outputs.status - run: echo needs.check_code_changed.outputs.status => ${{ needs.check_code_changed.outputs.status }} - - - name: Print needs.check_code_changed.outputs.status != true - run: echo needs.check_code_changed.outputs.status != true => ${{ needs.check_code_changed.outputs.status != 'true' }} - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 11 - uses: actions/setup-java@v3.11.0 - with: - java-version: '11' - distribution: 'adopt' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - # PROTOS - - name: Build Solidity Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-sol - - # BESU SDK - - name: Setup BESU SDK - run: make build-local - working-directory: weaver/sdks/besu/node - - # BESU NETWORK - - name: Start Besu Network - run: | - sudo apt install -y tmux jq - wget https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/22.7.0/besu-22.7.0.zip - unzip besu-22.7.0.zip - export PATH="${PWD}/besu-22.7.0/bin:$PATH" - wget https://artifacts.consensys.net/public/ethsigner/raw/names/ethsigner.zip/versions/22.1.3/ethsigner-22.1.3.zip - unzip ethsigner-22.1.3.zip - export PATH="${PWD}/ethsigner-22.1.3/bin:$PATH" - make start - sleep 100 - working-directory: weaver/tests/network-setups/besu - - # Deploy contracts - - name: Deploy contracts - run: | - make deploy-contracts - working-directory: weaver/samples/besu/simpleasset - - # BESU CLI - - name: Setup BESU CLI init - run: | - make build-local - cp config.template.json tmp.json - cp config.template.json tmp.json - jq -r '.network1.tokenContract |= "../simpleasset/build/contracts/${{ matrix.app_contract }}.json"' tmp.json > config.json - cp config.json tmp.json - jq -r '.network2.tokenContract |= "../simpleasset/build/contracts/BobERC20.json"' tmp.json > config.json - rm tmp.json - working-directory: weaver/samples/besu/besu-cli - - - name: Asset Exchange Besu CLI Tests - run: | - export PATH="${PWD}/bin:$PATH" - COUNT=0 - TOTAL=10 - - # HTLC Params - timeout=1000 - hashBase64="ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs=" - preimage="secrettext" - - # issue tokens to account 1 - initAmount=10 - transferAmount=5 - tokenId=0 - # & lock 5 token for account 2 in network 1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --asset_type=ERC20 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount} " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - # Is Asset locked - besu-cli asset is-locked --network=network1 --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "in Network network1: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - besu-cli asset claim --network=network1 --recipient_account=2 --preimage=${preimage} --token_id=${tokenId} --lock_contract_id=$LOCK_ID 1> tmp.out - cat tmp.out | grep "Account balance of the recipient in Network network1 before claiming: 0" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1 after claiming: ${transferAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ###### test unlock ####### - timeout=20 - initAmount=5 - recipientAmt=0 - transferAmount=2 - tokenId=1 - if [ ${{ matrix.app_contract }} == "AliceERC20" ]; then - recipientAmt=5 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - elif [ ${{ matrix.app_contract }} == "AliceERC1155" ]; then - besu-cli asset issue --network=network1 --account=1 --amount=${initAmount} --token_id=${tokenId} --token_data="" --asset_type=ERC1155 - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --amount=${transferAmount} --token_id=${tokenId} --timeout=${timeout} --asset_type=ERC1155 --hash_base64=${hashBase64} 1> tmp.out - else - initAmount=1 - transferAmount=1 - recipientAmt=1 - besu-cli asset issue --network=network1 --account=1 --token_id=${tokenId} --asset_type=ERC721 1> tmp.out - tokenId=$(cat tmp.out | grep "New ERC721 token minted with id " | sed -e 's/New ERC721 token minted with id //') - cat tmp.out - echo $tokenId - besu-cli asset lock --network=network1 --sender_account=1 --recipient_account=2 --token_id=${tokenId} --asset_type=ERC721 --timeout=${timeout} --hash_base64=${hashBase64} 1> tmp.out - fi - - balanceRem=$((initAmount-transferAmount)) - cat tmp.out | grep "Account balance of the sender in Network network1: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the sender in Network network1: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "Account balance of the recipient in Network network1: ${recipientAmt}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - tmp_string=$(cat tmp.out | grep "Lock contract ID:") - arrIN=(${tmp_string//:/ }) - LOCK_ID=${arrIN[3]} - - sleep $timeout - - besu-cli asset unlock --network=network1 --lock_contract_id=$LOCK_ID --sender_account=1 --token_id=${tokenId} 1> tmp.out - cat tmp.out | grep "before unlocking: ${balanceRem}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | grep "after unlocking: ${initAmount}" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/besu/besu-cli - diff --git a/.github/workflows/test_weaver-asset-exchange-corda.yaml b/.github/workflows/test_weaver-asset-exchange-corda.yaml deleted file mode 100644 index 43cc3dfc0da..00000000000 --- a/.github/workflows/test_weaver-asset-exchange-corda.yaml +++ /dev/null @@ -1,342 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Corda - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: asset-exchange-corda-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-asset-exchange-corda.yaml' - - asset-exchange-corda: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1 PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - working-directory: weaver/tests/network-setups/corda - - # FABRIC CLI - - name: Setup Corda CLI init - run: ./scripts/initAsset.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -p t1:50 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients claim-asset -f -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 5 -r "O=PartyB,L=London,C=GB" -p t1:50 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 5 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients unlock-asset -f -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - asset-exchange-corda-local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1-local PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - working-directory: weaver/tests/network-setups/corda - - # FABRIC CLI - - name: Setup Corda CLI init - run: ./scripts/initAsset.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -p t1:50 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients claim-asset -f -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients lock-asset -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 5 -r "O=PartyB,L=London,C=GB" -p t1:50 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 5 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients is-asset-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients unlock-asset -f -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - house-token-exchange-corda: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-asset-exchange-corda.yaml' - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - # CORDA NETWORK - - name: Start Corda Network - run: | - make start-network1 APP_NAME=house PROFILE=3-nodes - sleep 100 - docker logs corda_partya_1 - docker logs corda_partyb_1 - docker logs corda_partyc_1 - working-directory: weaver/tests/network-setups/corda - - # CORDA CLI - - name: Build CLI - run: | - cp ../../../tests/network-setups/corda/github.properties . - make build-cli - working-directory: weaver/samples/corda/corda-simple-application - - - name: Setup Corda CLI init - run: ./scripts/initHouseToken.sh 1 - working-directory: weaver/samples/corda/corda-simple-application - - - name: House Token Exchange Corda CLI Tests - run: | - COUNT=0 - TOTAL=5 - - # Lock 50 tokens - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token lock -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 180 -r "O=PartyA,L=London,C=GB" -o "O=PartyC,L=London,C=GB" -p house:10 1> tmp.out - cat tmp.out | grep "HTLC Lock State created with contract ID Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - - # Is Asset locked - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token is-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token claim -cid $CID -s secrettext 1> tmp.out - cat tmp.out | grep "Asset Claim Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Timeout - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token lock -f -h64 ivHErp1x4bJDKuRo6L5bApO/DdoyD/dG0mAZrzLZEIs= -t 10 -r "O=PartyB,L=London,C=GB" -p house:20 1> tmp.out - CID=$(cat tmp.out | grep "HTLC Lock State created with contract ID Right" | sed -e 's/.*Right(b=\(.*\))\./\1/') - sleep 10 - cat tmp.out - - ## Is asset lock false - CORDA_PORT=10009 ./clients/build/install/clients/bin/clients house-token is-locked -cid $CID 1> tmp.out - cat tmp.out | grep "Is Asset Locked Response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ## Unlock asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token unlock -cid $CID 1> tmp.out - cat tmp.out | grep "Asset Unlock Response: Right" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application diff --git a/.github/workflows/test_weaver-asset-exchange-fabric.yaml b/.github/workflows/test_weaver-asset-exchange-fabric.yaml deleted file mode 100644 index bdaa32506e4..00000000000 --- a/.github/workflows/test_weaver-asset-exchange-fabric.yaml +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Exchange Fabric - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Allows you to run this workflow manually from the Actions tab - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: asset-exchange-fabric-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-asset-exchange-fabric.yaml' - - asset-exchange-fabric: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop CHAINCODE_NAME=simpleasset PROFILE="2-nodes" - working-directory: weaver/tests/network-setups/fabric/dev - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Fabric CLI - run: npm install - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: ./scripts/initAsset.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Asset Exchange Fabric CLI Tests - run: | - COUNT=0 - TOTAL=1 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset exchange-all --network1=network1 --network2=network2 --secret=secrettext --timeout-duration=100 bob:bond01:a04:alice:token1:100 &> tmp.out - tail -n 2 tmp.out | grep "Asset Exchange Complete." && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - asset-exchange-fabric-local: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' }} - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - # Build Dependencies - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local CHAINCODE_NAME=simpleasset - working-directory: weaver/tests/network-setups/fabric/dev - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: ./scripts/initAsset.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Asset Exchange Fabric CLI Tests - run: | - COUNT=0 - TOTAL=1 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset exchange-all --network1=network1 --network2=network2 --secret=secrettext --timeout-duration=100 bob:bond01:a04:alice:token1:100 &> tmp.out - tail -n 2 tmp.out | grep "Asset Exchange Complete." && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli diff --git a/.github/workflows/test_weaver-asset-transfer.yaml b/.github/workflows/test_weaver-asset-transfer.yaml deleted file mode 100644 index 1c120be82d4..00000000000 --- a/.github/workflows/test_weaver-asset-transfer.yaml +++ /dev/null @@ -1,1366 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Asset Transfer - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: asset-transfer-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-asset-transfer.yaml' - - asset-transfer: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - - name: Start Corda Network - run: make start &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop CHAINCODE_NAME=simpleassettransfer PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - docker logs corda_network2_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Fabric CLI - run: | - npm install --global yarn - make build - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set-file ./.env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE simpleassettransfer - ./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json - ./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca - ./bin/fabric-cli config set network1 chaincode simpleassettransfer - ./bin/fabric-cli config set network2 chaincode simpleassettransfer - cp chaincode.json.template chaincode.json - cp remote-network-config.json.template remote-network-config.json - sed -i "s#localhost:9080#relay-network1:9080#g" remote-network-config.json - sed -i "s#localhost:9081#relay-corda:9081#g" remote-network-config.json - sed -i "s#localhost:9082#relay-corda2:9082#g" remote-network-config.json - sed -i "s#localhost:9083#relay-network2:9083#g" remote-network-config.json - sed -i "s#localhost:10006#corda_partya_1:10003#g" remote-network-config.json - sed -i "s#localhost:30006#corda_network2_partya_1:10003#g" remote-network-config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: | - ./bin/fabric-cli configure create all --local-network=network1 - ./bin/fabric-cli configure create all --local-network=network2 - ./bin/fabric-cli configure network --local-network=network1 --num-orgs=2 - ./bin/fabric-cli configure network --local-network=network2 --num-orgs=2 - ./scripts/initAssetsForTransfer.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Setup - run: | - cp remote-network-config.json.template remote-network-config.json - sed -i "s#localhost:9080#relay-network1:9080#g" remote-network-config.json - sed -i "s#localhost:9081#relay-corda:9081#g" remote-network-config.json - sed -i "s#localhost:9082#relay-corda2:9082#g" remote-network-config.json - sed -i "s#localhost:9083#relay-network2:9083#g" remote-network-config.json - sed -i "s#localhost:10006#corda_partya_1:10003#g" remote-network-config.json - sed -i "s#localhost:30006#corda_network2_partya_1:10003#g" remote-network-config.json - working-directory: weaver/samples/corda/corda-simple-application/clients/src/main/resources/config - - - name: Corda CLI Initialize Vault - run: make initialise-vault-asset-transfer-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=9 - - # Issue t1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - # Pledge Asset - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim Remote Asset - NETWORK_NAME='Corda_Network2' CORDA_PORT=30006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='O=PartyA, L=London, C=GB' --transfer-category='token.corda' --export-network-id='Corda_Network' --param='t1:5' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "\[\]" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA-CORDA2 - - # Issue and Pledge t2:5 tokens - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t2 1> tmp.out - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t2:5' 1> tmp.out - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - sleep 20 - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.corda' --import-network-id='Corda_Network2' --param='t2:5' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t2 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t2, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Non-Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=bond --ref=a03 --data-file=src/data/assetsForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a03 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a03 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network2 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=bond --ref=a04 --data-file=src/data/assetsForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a04 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=token --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=token --units=100 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - # CORDA - FABRIC - - name: Corda - Fabric Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=2 - - # CORDA - FABRIC1 - # Issue and Pledge token1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='network1' --recipient='alice' --param='token1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "CF_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Corda - Fabric Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=3 - - PID=${{ env.CF_PID }} - - # CORDA - FABRIC1 - # Claim in Fabric (pledged in Corda) - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer claim --source-network='Corda_Network' --dest-network=network1 --user='alice' --owner='O=PartyA, L=London, C=GB' --type='token.corda' --pledge-id=$PID --param=token1:5 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9955\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Corda - Fabric Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - # CORDA - FABRIC1 - # Issue and Pledge token1:10 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 10 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='network1' --recipient='alice' --param='token1:10' 1> tmp.out - sleep 20 - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.fabric' --import-network-id='network1' --param='token1:10' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=10, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=1 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=3600 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "FC_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric - Corda Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=2 - - PID=${{ env.FC_PID }} - - # FABRIC - CORDA - # Claim Remote Asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='alice' --transfer-category='token.fabric' --export-network-id='network1' --param='token1:50' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=50, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=30 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9855\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - ./bin/fabric-cli asset transfer reclaim --source-network='network1' --user='alice' --type='token.corda' --pledge-id=$PID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - if: failure() - name: DEBUG Logs - corda partya - run: docker logs corda_partya_1 - - - if: failure() - name: DEBUG Logs - corda network2 partya - run: docker logs corda_network2_partya_1 - - - if: failure() - name: DEBUG Logs - fabric n1 relay - run: docker logs relay-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 relay - run: docker logs relay-network2 - - - if: failure() - name: DEBUG Logs - corda relay - run: docker logs relay-corda - - - if: failure() - name: DEBUG Logs - corda2 relay - run: docker logs relay-corda2 - - - if: failure() - name: DEBUG Logs - fabric n1 driver - run: docker logs driver-fabric-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 driver - run: docker logs driver-fabric-network2 - - - if: failure() - name: DEBUG Logs - corda driver - run: docker logs driver-corda-Corda_Network - - - if: failure() - name: DEBUG Logs - corda2 driver - run: docker logs driver-corda-Corda_Network2 - - - if: failure() - name: DEBUG Logs - iin agent n1 org1 - run: docker logs iin-agent-Org1MSP-network1 - - - if: failure() - name: DEBUG Logs - iin agent n2 org1 - run: docker logs iin-agent-Org1MSP-network2 - - asset-transfer-local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - - name: Build Corda Driver - run: make build-local - working-directory: weaver/core/drivers/corda-driver - - # CORDA NETWORK - - name: Start Corda Network - run: make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - - name: Start Fabric Network - run: make start-interop-local CHAINCODE_NAME=simpleassettransfer - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - docker logs corda_network2_partya_1 - working-directory: weaver - - # RELAY - - name: Start Relay for network1 - run: RELAY_CONFIG=config/Fabric_Relay.toml cargo run --bin server &> relay-n1.out & - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: RELAY_CONFIG=config/Fabric_Relay2.toml cargo run --bin server &> relay-n2.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: RELAY_CONFIG=config/Corda_Relay.toml cargo run --bin server &> relay-corda.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: RELAY_CONFIG=config/Corda_Relay2.toml cargo run --bin server &> relay-corda2.out & - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - cp .env.template .env - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s#path_to_connection_profile#${CCP_PATH}#g" .env - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: npm run dev &> fdriver-n1.out & - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: CONNECTION_PROFILE=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json NETWORK_NAME=network2 RELAY_ENDPOINT=localhost:9083 DRIVER_ENDPOINT=localhost:9095 npm run dev &> fdriver-n2.out & - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Config - run: | - # FABRIC CONFIG - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n1.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n1.json - cat src/fabric-ledger/config-n1.json - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n2.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n2.json - cat src/fabric-ledger/config-n2.json - # DNS CONFIG - sed -i "s#iin-agent-Org1MSP-network1#localhost#g" docker-testnet/configs/dnsconfig.json - sed -i "s#iin-agent-Org1MSP-network2#localhost#g" docker-testnet/configs/dnsconfig.json - cat docker-testnet/configs/dnsconfig.json - working-directory: weaver/core/identity-management/iin-agent - - - name: Setup Fabric IIN Env - run: | - cp .env.template .env - sed -i "s##Org1MSP#g" .env - sed -i "s#^DLT_TYPE=.*#DLT_TYPE=fabric#g" .env - sed -i "s##interop#g" .env - sed -i "s#^DNS_CONFIG_PATH=#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig.json#g" .env - sed -i "s#^SECURITY_DOMAIN_CONFIG_PATH=#SECURITY_DOMAIN_CONFIG_PATH=./docker-testnet/configs/security-domain-config.json#g" .env - sed -i "s#^CONFIG_PATH=#CONFIG_PATH=./src/fabric-ledger/config-n1.json#g" .env - sed -i "s#^AUTO_SYNC=#AUTO_SYNC=false#g" .env - cat .env - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: npm run dev &> iinagent-n1.out & - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: IIN_AGENT_ENDPOINT=localhost:9501 SECURITY_DOMAIN=network2 CONFIG_PATH=./src/fabric-ledger/config-n2.json npm run dev &> iinagent-n2.out & - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda_Network Driver - run: ./build/install/driver-corda/bin/driver-corda &> corda-driver.out & - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: DRIVER_PORT=9098 ./build/install/driver-corda/bin/driver-corda &> corda2-driver.out & - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set-file ./.env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE simpleassettransfer - ./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json - ./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - ###### Change line number in following commands if config is modified ##### - ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca - ./bin/fabric-cli config set network1 chaincode simpleassettransfer - ./bin/fabric-cli config set network2 chaincode simpleassettransfer - cp chaincode.json.template chaincode.json - cp remote-network-config.json.template remote-network-config.json - working-directory: weaver/samples/fabric/fabric-cli - - - - name: Fabric CLI Init - run: | - ./bin/fabric-cli configure create all --local-network=network1 - ./bin/fabric-cli configure create all --local-network=network2 - ./bin/fabric-cli configure network --local-network=network1 - ./bin/fabric-cli configure network --local-network=network2 - ./scripts/initAssetsForTransfer.sh - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n1.out - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 10 - tail -10 ../../../core/identity-management/iin-agent/iinagent-n2.out - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Setup - run: | - cp remote-network-config.json.template remote-network-config.json - working-directory: weaver/samples/corda/corda-simple-application/clients/src/main/resources/config - - - name: Corda CLI Initialize Vault - run: make initialise-vault-asset-transfer - working-directory: weaver/samples/corda/corda-simple-application - - - name: Asset Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=9 - - # Issue t1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - # Pledge Asset - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # Claim Remote Asset - NETWORK_NAME='Corda_Network2' CORDA_PORT=30006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='O=PartyA, L=London, C=GB' --transfer-category='token.corda' --export-network-id='Corda_Network' --param='t1:5' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "\[\]" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA-CORDA2 - - # Issue and Pledge t2:5 tokens - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 t2 1> tmp.out - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='Corda_Network2' --recipient='O=PartyA, L=London, C=GB' --param='t2:5' 1> tmp.out - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - sleep 20 - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.corda' --import-network-id='Corda_Network2' --param='t2:5' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t2 1> tmp.out - cat tmp.out | grep "AssetState(quantity=5, tokenType=t2, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Non-Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=bond --ref=a03 --data-file=src/data/assetsForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a03 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a03 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a03"]' --local-network=network2 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a03\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=bond --ref=a04 --data-file=src/data/assetsForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=bond.fabric --pledge-id=$CID --param=bond01:a04 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out - #tail -n 1 tmp.out | grep "Result from network query: {\"type\":\"bond01\",\"id\":\"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer ReadAsset '["bond01","a04"]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Error: the asset a04 does not exist" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - # FABRIC CLI - - name: Asset Transfer Fabric CLI Fungible Tests - run: | - COUNT=0 - TOTAL=8 - - # FABRIC2 - FABRIC1 - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=3600 --type=token --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - tail -n 1 tmp.out | grep "Asset pledged with ID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - # FABRIC1 - FABRIC2 - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer pledge --source-network=network1 --dest-network=network2 --recipient=bob --expiry-secs=20 --type=token --units=100 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - cat tmp.out - - CID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - sleep 20 - - ./bin/fabric-cli asset transfer claim --source-network=network1 --dest-network=network2 --user=bob --owner=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "cannot claim asset with pledgeId $CID as the expiry time has elapsed" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer reclaim --source-network=network1 --user=alice --type=token.fabric --pledge-id=$CID --param=token1:100 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $CID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=bob mychannel simpleassettransfer GetMyWallet '[]' --local-network=network2 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"50\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - # CORDA - FABRIC - - name: Corda - Fabric Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=2 - - # CORDA - FABRIC1 - # Issue and Pledge token1:5 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 5 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="3600" --import-network-id='network1' --recipient='alice' --param='token1:5' 1> tmp.out - cat tmp.out | grep "AssetPledgeState created with pledge-id" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: true" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "CF_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Corda - Fabric Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=3 - - PID=${{ env.CF_PID }} - - # CORDA - FABRIC1 - # Claim in Fabric (pledged in Corda) - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9950\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli asset transfer claim --source-network='Corda_Network' --dest-network=network1 --user='alice' --owner='O=PartyA, L=London, C=GB' --type='token.corda' --pledge-id=$PID --param=token1:5 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ClaimRemoteTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9955\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Corda - Fabric Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - # CORDA - FABRIC1 - # Issue and Pledge token1:10 tokens to partyA - NETWORK_NAME='Corda_Network' CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 10 token1 1> tmp.out - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer pledge-asset --fungible --timeout="20" --import-network-id='network1' --recipient='alice' --param='token1:10' 1> tmp.out - sleep 20 - - PID=$(cat tmp.out | grep "AssetPledgeState created with pledge-id " | awk -F "'" '{print $2}') - - # Is Asset Pledged - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer is-asset-pledged -pid $PID 1> tmp.out - cat tmp.out | grep "Is asset pledged for transfer response: false" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer reclaim-pledged-asset --pledge-id=$PID --export-relay-address='localhost:9081' --transfer-category='token.fabric' --import-network-id='network1' --param='token1:10' 1> tmp.out - cat tmp.out | grep "Pledged Asset Reclaim Response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=10, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 1 - Pledge - run: | - COUNT=0 - TOTAL=1 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=3600 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - echo "FC_PID=$PID" >> $GITHUB_ENV - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric - Corda Asset Transfer test 2 - Claim - run: | - COUNT=0 - TOTAL=2 - - PID=${{ env.FC_PID }} - - # FABRIC - CORDA - # Claim Remote Asset - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients transfer claim-remote-asset --pledge-id=$PID --locker='alice' --transfer-category='token.fabric' --export-network-id='network1' --param='token1:50' --import-relay-address='localhost:9082' 1> tmp.out - cat tmp.out | grep "Pledged asset claim response: Right(b=SignedTransaction(id=" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type token1 1> tmp.out - cat tmp.out | grep "AssetState(quantity=50, tokenType=token1, owner=O=PartyA, L=London, C=GB, " && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/corda/corda-simple-application - - - name: Fabric - Corda Asset Transfer test 3 - Reclaim - run: | - COUNT=0 - TOTAL=3 - - ./bin/fabric-cli asset transfer pledge --source-network='network1' --dest-network='Corda_Network' --recipient='O=PartyA, L=London, C=GB' --expiry-secs=30 --type='token' --units=50 --owner=alice --data-file=src/data/tokensForTransfer.json &> tmp.out - PID=$(cat tmp.out | grep "Asset pledged with ID " | sed -e 's/Asset pledged with ID //') - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9855\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - sleep 30 - - ./bin/fabric-cli asset transfer reclaim --source-network='network1' --user='alice' --type='token.corda' --pledge-id=$PID --param=token1:50 &> tmp.out - tail -n 1 tmp.out | grep "Called Function ReclaimTokenAsset. With Args: $PID" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query --user=alice mychannel simpleassettransfer GetMyWallet '[]' --local-network=network1 &> tmp.out - tail -n 2 tmp.out | grep "Result from network query: token1=\"9905\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - - working-directory: weaver/samples/fabric/fabric-cli - - - if: failure() - name: DEBUG Logs - corda partya - run: docker logs corda_partya_1 - - - if: failure() - name: DEBUG Logs - corda network2 partya - run: docker logs corda_network2_partya_1 - - - if: failure() - name: DEBUG Logs - fabric n1 relay - run: cat weaver/core/relay/relay-n1.out - - - if: failure() - name: DEBUG Logs - fabric n2 relay - run: cat weaver/core/relay/relay-n2.out - - - if: failure() - name: DEBUG Logs - corda relay - run: cat weaver/core/relay/relay-corda.out - - - if: failure() - name: DEBUG Logs - corda2 relay - run: cat weaver/core/relay/relay-corda2.out - - - if: failure() - name: DEBUG Logs - fabric n1 driver - run: cat weaver/core/drivers/fabric-driver/fdriver-n1.out - - - if: failure() - name: DEBUG Logs - fabric n2 driver - run: cat weaver/core/drivers/fabric-driver/fdriver-n2.out - - - if: failure() - name: DEBUG Logs - corda driver - run: cat weaver/core/drivers/corda-driver/corda-driver.out - - - if: failure() - name: DEBUG Logs - corda2 driver - run: cat weaver/core/drivers/corda-driver/corda2-driver.out - - - if: failure() - name: DEBUG Logs - iin agent n1 org1 - run: cat weaver/core/identity-management/iin-agent/iinagent-n1.out - - - if: failure() - name: DEBUG Logs - iin agent n2 org1 - run: cat weaver/core/identity-management/iin-agent/iinagent-n2.out diff --git a/.github/workflows/test_weaver-corda-interop-app.yaml b/.github/workflows/test_weaver-corda-interop-app.yaml deleted file mode 100644 index bd65c6e9a5e..00000000000 --- a/.github/workflows/test_weaver-corda-interop-app.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Unit Test Corda Interop App - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - - -concurrency: - group: corda-interop-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_code_changed: - outputs: - interop_cordapp_changed: ${{ steps.changes.outputs.interop_cordapp_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - interop_cordapp_changed: - - './weaver/common/protos-java-kt/**' - - './weaver/core/network/corda-interop-app/**' - - '.github/workflows/test_weaver-corda-interop-app.yaml' - - unit_test_interop_cordapp: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interop_cordapp_changed == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Build Protos (Local) - run: make build - working-directory: weaver/common/protos-java-kt - - - name: Build Corda Interop App (Local) - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Run Tests (Local) - run: make test - working-directory: weaver/core/network/corda-interop-app diff --git a/.github/workflows/test_weaver-data-sharing.yaml b/.github/workflows/test_weaver-data-sharing.yaml deleted file mode 100644 index 82e2de6d038..00000000000 --- a/.github/workflows/test_weaver-data-sharing.yaml +++ /dev/null @@ -1,1268 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This is a basic workflow to help you get started with Actions - -name: Test Data Sharing - -env: - NODEJS_VERSION: v18.18.2 - -# Controls when the workflow will run -on: - workflow_call: - inputs: - run_all: - required: true - type: string - - -concurrency: - group: data-sharing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-data-sharing.yaml' - - data-sharing: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - # CORDA NETWORK - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - ./scripts/get-cordapps.sh || mv github.main.properties github.properties - - cat github.properties - working-directory: weaver/tests/network-setups/corda - - - name: Start Corda Network - run: make start &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Fabric CLI - run: | - npm install --global yarn - make build - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 --num-orgs=2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs iin-agent-Org1MSP-network1 - docker logs iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-corda2:9082/Corda_Network2/corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-network1:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state localhost:9081 relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP relay-network1:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network1:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network2:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - if: failure() - name: DEBUG Logs - corda partya - run: docker logs corda_partya_1 - - - if: failure() - name: DEBUG Logs - corda network2 partya - run: docker logs corda_network2_partya_1 - - - if: failure() - name: DEBUG Logs - fabric n1 relay - run: docker logs relay-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 relay - run: docker logs relay-network2 - - - if: failure() - name: DEBUG Logs - corda relay - run: docker logs relay-corda - - - if: failure() - name: DEBUG Logs - corda2 relay - run: docker logs relay-corda2 - - - if: failure() - name: DEBUG Logs - fabric n1 driver - run: docker logs driver-fabric-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 driver - run: docker logs driver-fabric-network2 - - - if: failure() - name: DEBUG Logs - corda driver - run: docker logs driver-corda-Corda_Network - - - if: failure() - name: DEBUG Logs - corda2 driver - run: docker logs driver-corda-Corda_Network2 - - - if: failure() - name: DEBUG Logs - iin agent n1 org1 - run: docker logs iin-agent-Org1MSP-network1 - - - if: failure() - name: DEBUG Logs - iin agent n2 org1 - run: docker logs iin-agent-Org1MSP-network2 - - data-sharing-docker-local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' - env: - FREE_UP_GITHUB_RUNNER_DISK_SPACE_DISABLED: false - CONFIGURE_DISABLED: true - TOOLS_VALIDATE_BUNDLE_NAMES_DISABLED: true - CUSTOM_CHECKS_DISABLED: true - JEST_TEST_RUNNER_DISABLED: true - TAPE_TEST_RUNNER_DISABLED: true - DUMP_DISK_USAGE_INFO_DISABLED: true - FULL_BUILD_DISABLED: true - CHECK_WORK_TREE_STATUS_DISABLED: true - - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-data-sharing.yaml' - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - rm -rf protoc-3.15.6-linux-x86_64.zip - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 - - - name: CI script for cleanup - run: ./tools/ci.sh - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make build-server-local - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-image-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Corda Driver - run: make image-local - working-directory: weaver/core/drivers/corda-driver - - - name: Build IIN Agent - run: make build-image-local - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Corda Network - run: make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local PROFILE='2-nodes' - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Edit Relay docker compose - run: make convert-compose-method2 - working-directory: weaver/core/relay - - - name: Start Relay for network1 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.n1 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n1' - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.n2 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.n2' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.corda - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda' - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-relay-server#g" docker/testnet-envs/.env.corda2 - make start-server COMPOSE_ARG='--env-file docker/testnet-envs/.env.corda2' - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-fabric#g" docker-testnet-envs/.env.n1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-fabric#g" docker-testnet-envs/.env.n2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet-envs/.env.n2 - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n1' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n1 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.n2' NETWORK_NAME=$(grep NETWORK_NAME docker-testnet-envs/.env.n2 | cut -d '=' -f 2) - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Env - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n1.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n1.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n1.org2 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n2.org1 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org1 - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-iin-agent#g" docker-testnet/envs/.env.n2.org2 - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^AUTO_SYNC=true#AUTO_SYNC=false#g" docker-testnet/envs/.env.n2.org2 - sed -i "s#^DNS_CONFIG_PATH=.*#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig-2-nodes.json#g" docker-testnet/envs/.env.n2.org2 - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n1.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n1.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: | - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org1' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org1 | cut -d '=' -f 2) - make deploy COMPOSE_ARG='--env-file docker-testnet/envs/.env.n2.org2' DLT_SPECIFIC_DIR=$(grep DLT_SPECIFIC_DIR docker-testnet/envs/.env.n2.org2 | cut -d '=' -f 2) - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda Driver - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-corda#g" docker-testnet-envs/.env.corda - make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda' - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: | - sed -i "s#^DOCKER_IMAGE_NAME=.*#DOCKER_IMAGE_NAME=cacti-weaver-driver-corda#g" docker-testnet-envs/.env.corda2 - make deploy COMPOSE_ARG='--env-file docker-testnet-envs/.env.corda2' - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials_docker - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 --num-orgs=2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 30 - docker logs --tail 5 iin-agent-Org1MSP-network1 - docker logs --tail 5 iin-agent-Org1MSP-network2 - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 30 - docker logs --tail 5 iin-agent-Org1MSP-network1 - docker logs --tail 5 iin-agent-Org1MSP-network2 - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault-docker - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state --wkey=H localhost:9081 relay-corda2:9082/Corda_Network2/corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state --wkey=a localhost:9081 relay-network1:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state --wkey=Arcturus localhost:9081 relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP relay-network1:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP relay-network2:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network1:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true relay-network2:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP relay-corda:9081/Corda_Network/corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - if: failure() - name: DEBUG Logs - corda partya - run: docker logs corda_partya_1 - - - if: failure() - name: DEBUG Logs - corda network2 partya - run: docker logs corda_network2_partya_1 - - - if: failure() - name: DEBUG Logs - fabric n1 relay - run: docker logs relay-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 relay - run: docker logs relay-network2 - - - if: failure() - name: DEBUG Logs - corda relay - run: docker logs relay-corda - - - if: failure() - name: DEBUG Logs - corda2 relay - run: docker logs relay-corda2 - - - if: failure() - name: DEBUG Logs - fabric n1 driver - run: docker logs driver-fabric-network1 - - - if: failure() - name: DEBUG Logs - fabric n2 driver - run: docker logs driver-fabric-network2 - - - if: failure() - name: DEBUG Logs - corda driver - run: docker logs driver-corda-Corda_Network - - - if: failure() - name: DEBUG Logs - corda2 driver - run: docker logs driver-corda-Corda_Network2 - - - if: failure() - name: DEBUG Logs - iin agent n1 org1 - run: docker logs iin-agent-Org1MSP-network1 - - - if: failure() - name: DEBUG Logs - iin agent n2 org1 - run: docker logs iin-agent-Org1MSP-network2 - - data-sharing-local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-data-sharing.yaml' - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 - - # PROTOS - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Java Protos - run: make build - working-directory: weaver/common/protos-java-kt - - # Build Dependencies - - name: Build Corda Interop App - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK - run: make build - working-directory: weaver/sdks/corda - - - name: Build Corda SimpleApplication - run: make build-local - working-directory: weaver/samples/corda/corda-simple-application - - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-local - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Corda Driver - run: make build-local - working-directory: weaver/core/drivers/corda-driver - - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - # CORDA NETWORK - - name: Start Corda Network - run: make start-local &> corda-net.out & - working-directory: weaver/tests/network-setups/corda - - # FABRIC NETWORK - - - name: Start Fabric Network - run: make start-interop-local - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Corda Network logs - run: | - cat tests/network-setups/corda/corda-net.out - docker logs corda_partya_1 - working-directory: weaver - - # RELAY - - name: Start Relay for network1 - run: RELAY_CONFIG=config/Fabric_Relay.toml cargo run --bin server &> relay-n1.out & - working-directory: weaver/core/relay - - - name: Start Relay for network2 - run: RELAY_CONFIG=config/Fabric_Relay2.toml cargo run --bin server &> relay-n2.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network - run: RELAY_CONFIG=config/Corda_Relay.toml cargo run --bin server &> relay-corda.out & - working-directory: weaver/core/relay - - - name: Start Relay for Corda_Network2 - run: RELAY_CONFIG=config/Corda_Relay2.toml cargo run --bin server &> relay-corda2.out & - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - cp .env.template .env - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s#path_to_connection_profile#${CCP_PATH}#g" .env - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 - run: npm run dev &> fdriver-n1.out & - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network2 - run: CONNECTION_PROFILE=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json NETWORK_NAME=network2 RELAY_ENDPOINT=localhost:9083 DRIVER_ENDPOINT=localhost:9095 npm run dev &> fdriver-n2.out & - working-directory: weaver/core/drivers/fabric-driver - - # IIN AGENT - - name: Setup Fabric IIN Config - run: | - # FABRIC CONFIG - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n1.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network1/peerOrganizations/org1.network1.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n1.json - cat src/fabric-ledger/config-n1.json - cp src/fabric-ledger/config.json.template src/fabric-ledger/config-n2.json - CCP_PATH=${GITHUB_WORKSPACE}/weaver/tests/network-setups/fabric/shared/network2/peerOrganizations/org1.network2.com/connection-org1.json - sed -i "s##${CCP_PATH}#g" src/fabric-ledger/config-n2.json - cat src/fabric-ledger/config-n2.json - # DNS CONFIG - sed -i "s#iin-agent-Org1MSP-network1#localhost#g" docker-testnet/configs/dnsconfig.json - sed -i "s#iin-agent-Org1MSP-network2#localhost#g" docker-testnet/configs/dnsconfig.json - cat docker-testnet/configs/dnsconfig.json - working-directory: weaver/core/identity-management/iin-agent - - - name: Setup Fabric IIN Env - run: | - cp .env.template .env - sed -i "s##Org1MSP#g" .env - sed -i "s#^DLT_TYPE=.*#DLT_TYPE=fabric#g" .env - sed -i "s##interop#g" .env - sed -i "s#^DNS_CONFIG_PATH=#DNS_CONFIG_PATH=./docker-testnet/configs/dnsconfig.json#g" .env - sed -i "s#^SECURITY_DOMAIN_CONFIG_PATH=#SECURITY_DOMAIN_CONFIG_PATH=./docker-testnet/configs/security-domain-config.json#g" .env - sed -i "s#^CONFIG_PATH=#CONFIG_PATH=./src/fabric-ledger/config-n1.json#g" .env - sed -i "s#^AUTO_SYNC=#AUTO_SYNC=false#g" .env - cat .env - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network1 - run: npm run dev &> iinagent-n1.out & - working-directory: weaver/core/identity-management/iin-agent - - - name: Start Fabric IIN Agent for network2 - run: IIN_AGENT_ENDPOINT=localhost:9501 SECURITY_DOMAIN=network2 CONFIG_PATH=./src/fabric-ledger/config-n2.json npm run dev &> iinagent-n2.out & - working-directory: weaver/core/identity-management/iin-agent - - # CORDA DRIVER - - name: Start Corda_Network Driver - run: ./build/install/driver-corda/bin/driver-corda &> corda-driver.out & - working-directory: weaver/core/drivers/corda-driver - - - name: Start Corda_Network2 Driver - run: DRIVER_PORT=9098 ./build/install/driver-corda/bin/driver-corda &> corda2-driver.out & - working-directory: weaver/core/drivers/corda-driver - - # FABRIC CLI - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - working-directory: weaver/samples/fabric/fabric-cli - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - sed -i "s/CHAINCODE_PATH=.*/CHAINCODE_PATH=\.\/chaincode\.json/g" .env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - cat .env - cp chaincode.json.template chaincode.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Configure ALL - run: ./bin/fabric-cli configure all network1 network2 - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric Sync Membership using IIN Agent - run: | - ./bin/fabric-cli configure membership --local-network=network1 --target-network=network2 --iin-agent-endpoint=localhost:9500 - sleep 10 - tail -5 ../../../core/identity-management/iin-agent/iinagent-n1.out - ./bin/fabric-cli configure membership --local-network=network2 --target-network=network1 --iin-agent-endpoint=localhost:9501 - sleep 10 - tail -5 ../../../core/identity-management/iin-agent/iinagent-n2.out - working-directory: weaver/samples/fabric/fabric-cli - - # CORDA CLIENT - - name: Corda CLI Initialize Vault - run: make initialise-vault - working-directory: weaver/samples/corda/corda-simple-application - - - name: Data Transfer Corda Client Tests - run: | - COUNT=0 - TOTAL=8 - - # CORDA-CORDA2 - ./clients/build/install/clients/bin/clients request-state --wkey=H localhost:9081 localhost:9082/Corda_Network2/localhost:30006#com.cordaSimpleApplication.flow.GetStateByKey:H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state H 1> tmp.out - cat tmp.out | grep "SimpleState(key=H, value=\[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA2-CORDA - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients request-state --wkey=C localhost:9082 localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - NETWORK_NAME=Corda_Network2 CORDA_PORT=30006 ./clients/build/install/clients/bin/clients get-state C 1> tmp.out - cat tmp.out | grep "SimpleState(key=C, value=\[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC1 - ./clients/build/install/clients/bin/clients request-state --wkey=a localhost:9081 localhost:9080/network1/mychannel:simplestate:Read:a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state a 1> tmp.out - cat tmp.out | grep "SimpleState(key=a, value=Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # CORDA - FABRIC2 - ./clients/build/install/clients/bin/clients request-state --wkey=Arcturus localhost:9081 localhost:9083/network2/mychannel:simplestate:Read:Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./clients/build/install/clients/bin/clients get-state Arcturus 1> tmp.out - cat tmp.out | grep "SimpleState(key=Arcturus, value=17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/corda/corda-simple-application - - # FABRIC CLI - - name: Data Transfer Fabric CLI Tests - run: | - COUNT=0 - TOTAL=12 - - # FABRIC2 - FABRIC1 - cp chaincode.json.template chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP localhost:9080/network1/mychannel:simplestate:Read:a &> tmp.out - tail -n 1 tmp.out | grep "Args: a, Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["a"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Arcturus" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - FABRIC1 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"b\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --requesting-org=Org1MSP --e2e-confidentiality=true localhost:9080/network1/mychannel:simplestate:Read:b &> tmp.out - tail -n 1 tmp.out | grep "Args: b, Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["b"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: Betelgeuse" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - sed -i "s/\"args\"\: \[\"b\"/\"args\"\: \[\"Arcturus\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP localhost:9083/network2/mychannel:simplestate:Read:Arcturus &> tmp.out - tail -n 1 tmp.out | grep "Args: Arcturus, 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Arcturus"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 17.671" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - FABRIC2 - CONFIDENTIAL - sed -i "s/\"args\"\: \[\"Arcturus\"/\"args\"\: \[\"Betelgeuse\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --requesting-org=Org1MSP --e2e-confidentiality=true localhost:9083/network2/mychannel:simplestate:Read:Betelgeuse &> tmp.out - tail -n 1 tmp.out | grep "Args: Betelgeuse, 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["Betelgeuse"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: 617.1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC1 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"H\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network1 --sign=true --requesting-org=Org1MSP localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:H --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: H, \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["H"]' --local-network=network1 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=H, value=1" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # FABRIC2 - CORDA - cp chaincode.json.template chaincode.json - sed -i "s/\"args\"\: \[\"a\"/\"args\"\: \[\"C\"/g" chaincode.json - ./bin/fabric-cli interop --local-network=network2 --sign=true --requesting-org=Org1MSP localhost:9081/Corda_Network/localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:C --debug=true --debug=true &> tmp.out - tail -n 1 tmp.out | grep "Args: C, \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - ./bin/fabric-cli chaincode query mychannel simplestate read '["C"]' --local-network=network2 &> tmp.out - tail -n 1 tmp.out | grep "Result from network query: \[SimpleState(key=C, value=6" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - if: failure() - name: DEBUG Logs - corda partya - run: docker logs corda_partya_1 - - - if: failure() - name: DEBUG Logs - corda network2 partya - run: docker logs corda_network2_partya_1 - - - if: failure() - name: DEBUG Logs - fabric n1 relay - run: cat weaver/core/relay/relay-n1.out - - - if: failure() - name: DEBUG Logs - fabric n2 relay - run: cat weaver/core/relay/relay-n2.out - - - if: failure() - name: DEBUG Logs - corda relay - run: cat weaver/core/relay/relay-corda.out - - - if: failure() - name: DEBUG Logs - corda2 relay - run: cat weaver/core/relay/relay-corda2.out - - - if: failure() - name: DEBUG Logs - fabric n1 driver - run: cat weaver/core/drivers/fabric-driver/fdriver-n1.out - - - if: failure() - name: DEBUG Logs - fabric n2 driver - run: cat weaver/core/drivers/fabric-driver/fdriver-n2.out - - - if: failure() - name: DEBUG Logs - corda driver - run: cat weaver/core/drivers/corda-driver/corda-driver.out - - - if: failure() - name: DEBUG Logs - corda2 driver - run: cat weaver/core/drivers/corda-driver/corda2-driver.out - - - if: failure() - name: DEBUG Logs - iin agent n1 org1 - run: cat weaver/core/identity-management/iin-agent/iinagent-n1.out - - - if: failure() - name: DEBUG Logs - iin agent n2 org1 - run: cat weaver/core/identity-management/iin-agent/iinagent-n2.out diff --git a/.github/workflows/test_weaver-docker-build.yaml b/.github/workflows/test_weaver-docker-build.yaml deleted file mode 100644 index e7ae904e5fb..00000000000 --- a/.github/workflows/test_weaver-docker-build.yaml +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Test All Docker Images Build - -env: - NODEJS_VERSION: v18.18.2 - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: docker-build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_code_changed: - outputs: - relay_changed: ${{ steps.changes.outputs.relay_changed }} - fabric_driver_changed: ${{ steps.changes.outputs.fabric_driver_changed }} - corda_driver_changed: ${{ steps.changes.outputs.corda_driver_changed }} - iin_agent_changed: ${{ steps.changes.outputs.iin_agent_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - relay_changed: - - './weaver/common/protos-rs/**' - - './weaver/core/relay/**' - - '.github/workflows/test_weaver-docker-build.yaml' - - fabric_driver_changed: - - './weaver/common/protos/**' - - './weaver/common/protos-js/**' - - './weaver/sdks/fabric/interoperation-node-sdk/**' - - './weaver/core/drivers/fabric-driver/**' - - '.github/workflows/test_weaver-docker-build.yaml' - - corda_driver_changed: - - './weaver/common/protos/**' - - './weaver/common/protos-java-kt/**' - - './weaver/core/network/corda-interop-app/**' - - './weaver/sdks/corda/**' - - './weaver/core/drivers/corda-driver/**' - - '.github/workflows/test_weaver-docker-build.yaml' - - iin_agent_changed: - - './weaver/common/protos/**' - - './weaver/common/protos-js/**' - - './weaver/sdks/fabric/interoperation-node-sdk/**' - - './weaver/core/identity-management/iin-agent/**' - - '.github/workflows/test_weaver-docker-build.yaml' - - build_docker_relay: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.relay_changed == 'true' - # if: ${{ false }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Build Image - run: make build-server-local - working-directory: weaver/core/relay - - build_docker_fabric_driver_local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.fabric_driver_changed == 'true' - # if: ${{ false }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos (Local) - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Fabric Interop Node SDK (Local) - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Image (Local) - run: make build-image-local - working-directory: weaver/core/drivers/fabric-driver - - build_docker_fabric_driver_packages: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.fabric_driver_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Setup .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/drivers/fabric-driver - - - name: Build Image - run: make build-image - working-directory: weaver/core/drivers/fabric-driver - - build_docker_corda_driver_local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.corda_driver_changed == 'true' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Build Protos (Local) - run: make build - working-directory: weaver/common/protos-java-kt - - - name: Build Corda Interop App (Local) - run: make build-local - working-directory: weaver/core/network/corda-interop-app - - - name: Build Corda Interop SDK (Local) - run: make build - working-directory: weaver/sdks/corda - - - name: Build Image (Local) - run: make image-local - working-directory: weaver/core/drivers/corda-driver - - build_docker_corda_driver_packages: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.corda_driver_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties - - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.main.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties - echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties - - make build || mv github.main.properties github.properties - make clean - - cat github.properties - working-directory: weaver/core/drivers/corda-driver - - - name: Build Image - run: make image - working-directory: weaver/core/drivers/corda-driver - - build_docker_iin_agent_local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.iin_agent_changed == 'true' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos (Local) - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build Fabric Interop Node SDK (Local) - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Image - run: make build-image-local - working-directory: weaver/core/identity-management/iin-agent diff --git a/.github/workflows/test_weaver-fabric-fabric-satp.yaml b/.github/workflows/test_weaver-fabric-fabric-satp.yaml deleted file mode 100644 index 12f7f72ddb2..00000000000 --- a/.github/workflows/test_weaver-fabric-fabric-satp.yaml +++ /dev/null @@ -1,198 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Secure Test Asset Transfer - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: fabric-satp-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_code_changed: - outputs: - status: ${{ steps.changes.outputs.weaver_code_changed }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - weaver_code_changed: - - './weaver/**' - - '.github/workflows/test_weaver-fabric-fabric-satp.yaml' - - fabric-fabric-satp-local: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.status == 'true' }} - # if: ${{ false }} - # The type of runner that the job will run on - runs-on: ubuntu-latest - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Use Node.js 18.x - uses: actions/setup-node@v4.0.3 - with: - node-version: 18.x - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - go install google.golang.org/protobuf/cmd/protoc-gen-go@latest - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4.0 - - # PROTOS GO - - name: Build GO Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-go - - # PROTOS JS - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - # Build Dependencies - - name: Build Fabric Interop SDK - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build Fabric CLI - run: make build-local - working-directory: weaver/samples/fabric/fabric-cli - - - name: Build Relay - run: make - working-directory: weaver/core/relay - - - name: Build Fabric Driver - run: make build-local - working-directory: weaver/core/drivers/fabric-driver - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local CHAINCODE_NAME=satpsimpleasset - working-directory: weaver/tests/network-setups/fabric/dev - - - # GATEWAY - - name: Start Relay for network1 and network2 - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> gateway.out & - working-directory: weaver/core/relay - - # FABRIC DRIVER - - name: Setup Fabric Driver .env - run: | - cp .env.satp.template .env - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" .env - working-directory: weaver/core/drivers/fabric-driver - - - name: Start Fabric Driver for network1 and network2 - run: npm run dev &> fdriver.out & - working-directory: weaver/core/drivers/fabric-driver - - # FABRIC CLI - - name: Setup Fabric CLI ENV - run: | - echo ${GITHUB_WORKSPACE} - cp .env.template .env - ./bin/fabric-cli env set-file ./.env - ./bin/fabric-cli env set MEMBER_CREDENTIAL_FOLDER ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/src/data/credentials - ./bin/fabric-cli env set CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/config.json - ./bin/fabric-cli env set DEFAULT_APPLICATION_CHAINCODE satpsimpleasset - ./bin/fabric-cli env set REMOTE_CONFIG_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/remote-network-config.json - ./bin/fabric-cli env set CHAINCODE_PATH ${GITHUB_WORKSPACE}/weaver/samples/fabric/fabric-cli/chaincode.json - cat .env - working-directory: weaver/samples/fabric/fabric-cli - - - name: Setup Fabric CLI Config - run: | - echo ${GITHUB_WORKSPACE} - cp config.satp.template.json config.json - sed -i "s##${GITHUB_WORKSPACE}/weaver#g" config.json - ###### Change line number in following commands if config is modified ##### - ./bin/fabric-cli config set network2 aclPolicyPrincipalType ca - ./bin/fabric-cli config set network1 chaincode satpsimpleasset - ./bin/fabric-cli config set network2 chaincode satpsimpleasset - cp chaincode.json.template chaincode.json - cp remote-network-config.json.template remote-network-config.json - working-directory: weaver/samples/fabric/fabric-cli - - - name: Fabric CLI Init - run: | - ./bin/fabric-cli configure create all --local-network=network1 - ./bin/fabric-cli configure create all --local-network=network2 - ./bin/fabric-cli configure network --local-network=network1 - ./bin/fabric-cli configure network --local-network=network2 - ./scripts/initAsset.sh - working-directory: weaver/samples/fabric/fabric-cli - - # CLIENT - - name: Start the client to initiate the satp protocol - run: cargo run --bin satp_client "9085" "localhost:9085/Dummy_Network/abc:abc:abc:abc" - working-directory: weaver/core/relay - - # Test SATP - - name: Test SATP - run: | - COUNT=0 - TOTAL=1 - - ./bin/fabric-cli chaincode query --user=bob mychannel satpsimpleasset ReadAsset '["bond01","a04"]' --local-network=network1 &> tmp.out - cat tmp.out | tr '\n' ' ' | grep "Result from network query: { \"type\": \"bond01\", \"id\": \"a04\"" && COUNT=$(( COUNT + 1 )) && echo "PASS" - cat tmp.out - - # RESULT - echo "Passed $COUNT/$TOTAL Tests." - - if [ $COUNT == $TOTAL ]; then - exit 0 - else - exit 1 - fi - working-directory: weaver/samples/fabric/fabric-cli - - - name: DEBUG Logs - fabric n1 and n2 gateway - if: failure() - run: cat weaver/core/relay/gateway.out - - - name: DEBUG Logs - fabric n1 and n2 driver - if: failure() - run: cat weaver/core/drivers/fabric-driver/fdriver.out diff --git a/.github/workflows/test_weaver-go.yaml b/.github/workflows/test_weaver-go.yaml deleted file mode 100644 index 9bc42124f7c..00000000000 --- a/.github/workflows/test_weaver-go.yaml +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Unit Test Fabric Interop CC and Sample Chaincode - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: go-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - - debug_event_type: - runs-on: ubuntu-22.04 - steps: - - run: echo "${{ github.event_name }}" - - check_code_changed: - outputs: - interopcc_changed: ${{ steps.changes.outputs.interopcc_changed }} - gosdk_changed: ${{ steps.changes.outputs.gosdk_changed }} - gocli_changed: ${{ steps.changes.outputs.gocli_changed }} - simplestate_changed: ${{ steps.changes.outputs.simplestate_changed }} - satpsimpleasset_changed: ${{ steps.changes.outputs.satpsimpleasset_changed }} - simpleasset_changed: ${{ steps.changes.outputs.simpleasset_changed }} - simpleassetandinterop_changed: ${{ steps.changes.outputs.simpleassetandinterop_changed }} - simpleassettransfer_changed: ${{ steps.changes.outputs.simpleassettransfer_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - interopcc_changed: - - 'weaver/common/protos-go/**' - - 'weaver/core/network/fabric-interop-cc/**' - - '.github/workflows/test_weaver-go.yaml' - - gosdk_changed: - - 'weaver/sdks/fabric/go-sdk/**' - - gocli_changed: - - 'weaver/samples/fabric/go-cli/**' - - simplestate_changed: - - 'weaver/samples/fabric/simplestate/**' - - satpsimpleasset_changed: - - 'weaver/samples/fabric/satpsimpleasset/**' - - simpleasset_changed: - - 'weaver/samples/fabric/simpleasset/**' - - simpleassetandinterop_changed: - - 'weaver/samples/fabric/simpleassetandinterop/**' - - simpleassettransfer_changed: - - 'weaver/samples/fabric/simpleassettransfer/**' - - unit_test_interopcc: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor || echo "If this steps fails and asks to run 'go mod tidy' then run the script 'tools/go-mod-tidy.sh' to update all go modules" - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Test - run: go test -v ./... - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - unit_test_assetmgmt: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' - # if: ${{ false }} # disable - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Test - run: go test -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - build_test_libs_utils: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - build_test_libs_assetexchange: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Build - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - unit_test_sdk: - needs: check_code_changed - if: inputs.run_all == 'true' || ${{ needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.gosdk_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/sdks/fabric/go-sdk - - - name: Build - run: make build - working-directory: weaver/sdks/fabric/go-sdk - - - name: Test - run: make test - working-directory: weaver/sdks/fabric/go-sdk - - build_test_cli: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.gocli_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/go-cli - - - name: Build - run: make build - working-directory: weaver/samples/fabric/go-cli - - unit_test_simplestate: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.simplestate_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simplestate - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simplestate - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simplestate - - unit_test_satpsimpleasset: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.satpsimpleasset_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/satpsimpleasset - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/satpsimpleasset - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/satpsimpleasset - - unit_test_simpleasset: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.simpleasset_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleasset - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleasset - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleasset - - unit_test_simpleassetandinterop: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.simpleassetandinterop_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleassetandinterop - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleassetandinterop - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleassetandinterop - - unit_test_simpleassettransfer: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.simpleassettransfer_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Vendor - run: make run-vendor - working-directory: weaver/samples/fabric/simpleassettransfer - - - name: Build - run: go build -v ./... - working-directory: weaver/samples/fabric/simpleassettransfer - - - name: Test - run: go test -v ./... - working-directory: weaver/samples/fabric/simpleassettransfer - - unit_test_sdk_membership: - needs: check_code_changed - if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.interopcc_changed == 'true' || needs.check_code_changed.outputs.gosdk_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - # FABRIC NETWORK - - name: Start Fabric Network - run: make start-interop-local - working-directory: weaver/tests/network-setups/fabric/dev - - - name: Vendor - run: make run-vendor - working-directory: weaver/sdks/fabric/go-sdk - - - name: Build - run: make build - working-directory: weaver/sdks/fabric/go-sdk - - # Test the MembershipManager - - name: Test - run: GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn CACTI_ROOT=$GITHUB_WORKSPACE go test -v . - working-directory: weaver/sdks/fabric/go-sdk/membershipmanager diff --git a/.github/workflows/test_weaver-node-pkgs.yaml b/.github/workflows/test_weaver-node-pkgs.yaml deleted file mode 100644 index 31b9760eca1..00000000000 --- a/.github/workflows/test_weaver-node-pkgs.yaml +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Unit Test Weaver Node Packages - -env: - NODEJS_LTS_VERSION: v18.18.2 - NODEJS_NEXT_LTS_VERSION: v20.9.0 - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: node-pkg-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_code_changed: - outputs: - fabric_sdk_changed: ${{ steps.changes.outputs.fabric_sdk_changed }} - iin_agent_changed: ${{ steps.changes.outputs.iin_agent_changed }} - docs_changed: ${{ steps.changes.outputs.docs_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - fabric_sdk_changed: - - '.github/workflows/test_weaver-node-pkgs.yaml' - - 'weaver/common/protos/**' - - 'weaver/common/protos-js/**' - - 'weaver/sdks/fabric/interoperation-node-sdk/**' - - iin_agent_changed: - - '.github/workflows/test_weaver-node-pkgs.yaml' - - 'weaver/common/protos/**' - - 'weaver/common/protos-js/**' - - 'weaver/sdks/fabric/interoperation-node-sdk/**' - - 'weaver/core/identity-management/iin-agent/**' - - docs_changed: - - '.github/workflows/test_weaver-node-pkgs.yaml' - - 'docs/**' - - unit_test_weaver_node_sdk_local: - needs: check_code_changed - runs-on: ubuntu-22.04 - - strategy: - matrix: - node-version: [v18.18.2, v20.9.0] - exclude: - - node-version: ${{ needs.check_code_changed.outputs.fabric_sdk_changed != 'true' }} - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ matrix.node-version }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Tests - run: npm run test - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - unit_test_iin_agent_local: - needs: check_code_changed - runs-on: ubuntu-22.04 - - strategy: - matrix: - node-version: [v18.18.2, v20.9.0] - exclude: - - node-version: ${{ needs.check_code_changed.outputs.iin_agent_changed != 'true' }} - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ matrix.node-version }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build JS Protos - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Build - run: make build-local - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build IIN Agent - run: make build-local - working-directory: weaver/core/identity-management/iin-agent - - - name: Tests - run: npm run test - working-directory: weaver/core/identity-management/iin-agent - - build-docs: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.docs_changed == 'true' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Python 3.x - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: 'pip' # caching pip dependencies - - - name: Install dependencies - run: pip install -r requirements.txt - working-directory: docs - - - name: Build - run: mkdocs build - working-directory: docs diff --git a/.github/workflows/test_weaver-pre-release.yaml b/.github/workflows/test_weaver-pre-release.yaml deleted file mode 100644 index 1e6daf9c59a..00000000000 --- a/.github/workflows/test_weaver-pre-release.yaml +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Pre-release Test Weaver Module versions - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: pre-release-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_release: - outputs: - status: ${{ steps.early.outputs.status }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - name: Ignore if not a release PR - id: early - env: - TITLE: ${{ github.event.pull_request.title }} - run : | - status="skip" - if echo ${TITLE} | grep -q "chore(release)"; then - status="continue" - fi - echo "status=$status" >> $GITHUB_OUTPUT - - test_weaver_pre-release: - needs: check_release - if: inputs.run_all == 'true' || needs.check_release.outputs.status == 'continue' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Get release verison from PR title - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - # Assuming release PR follows pattern: chore(release): publish vA.B.C - # Split PR title by space, and take 3rd word - VERSION=$(echo "${TITLE}" | cut -d ' ' -f 3) - # Strip "v" from version - VERSION=$(echo $VERSION | sed -e 's/^v//') - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo $VERSION - - # Gradle - - name: check weaver/common/protos-java-kt/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-java-kt - - - name: check weaver/core/network/corda-interop-app/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/core/network/corda-interop-app - - - name: check weaver/sdks/corda/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/sdks/corda - - - name: check weaver/core/drivers/corda-driver/gradle.properties - run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/corda-driver - - # NodeJS - - name: check weaver/common/protos-js/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-js - - - name: check weaver/sdks/fabric/interoperation-node-sdk/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: check weaver/sdks/besu/node/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/sdks/besu/node - - - name: check weaver/core/drivers/fabric-driver/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/fabric-driver - - - name: check weaver/core/identity-management/iin-agent/package.json - run: cat package.json | grep "version" | grep $VERSION || exit 1 - working-directory: weaver/core/identity-management/iin-agent - - # Rust - - name: check weaver/common/protos-rs/pkg/Cargo.toml - run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1 - working-directory: weaver/common/protos-rs/pkg - - - name: check weaver/core/relay/Cargo.toml - run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1 - working-directory: weaver/core/relay - - # Docker - - name: check weaver/core/drivers/corda-driver/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/corda-driver - - - name: check weaver/core/drivers/fabric-driver/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/drivers/fabric-driver - - - name: check weaver/core/identity-management/iin-agent/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/identity-management/iin-agent - - - name: check weaver/core/relay/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/relay - - # GO - - name: check weaver/common/protos-go/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/common/protos-go - - - name: check weaver/core/network/fabric-interop-cc/libs/utils/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: check weaver/core/network/fabric-interop-cc/libs/assetexchange/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: check weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: check weaver/core/network/fabric-interop-cc/contracts/interop/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: check weaver/sdks/fabric/go-sdk/VERSION - run: cat VERSION | grep $VERSION || exit 1 - working-directory: weaver/sdks/fabric/go-sdk - - test_weaver_go_pre-release: - needs: check_release - if: inputs.run_all == 'true' || needs.check_release.outputs.status == 'continue' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Get release verison from PR title - env: - TITLE: ${{ github.event.pull_request.title }} - run: | - # Assuming release PR follows pattern: chore(release): publish vA.B.C - # Split PR title by space, and take 3rd word - VERSION=$(echo "${TITLE}" | cut -d ' ' -f 3) - # Strip "v" from version - VERSION=$(echo $VERSION | sed -e 's/^v//') - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo $VERSION - - - name: Update GO Checksum - run: ./go-gen-checksum.sh $VERSION - working-directory: tools - - - name: Check if changes are committed - run: (git status | grep "nothing to commit, working tree clean") || (echo "go-gen-checksum not called before release commit" && exit 1) diff --git a/.github/workflows/test_weaver-relay.yaml b/.github/workflows/test_weaver-relay.yaml deleted file mode 100644 index 28934d2c8b4..00000000000 --- a/.github/workflows/test_weaver-relay.yaml +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Unit Test Relay - -on: - workflow_call: - inputs: - run_all: - required: true - type: string - -concurrency: - group: relay-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - check_code_changed: - outputs: - relay_changed: ${{ steps.changes.outputs.relay_changed }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4.1.7 - - - uses: dorny/paths-filter@v2.11.1 - id: changes - with: - filters: | - relay_changed: - - './weaver/common/protos/**' - - './weaver/common/protos-rs/**' - - './weaver/core/relay/**' - - '.github/workflows/test_weaver-relay.yaml' - - unit_test_relay_local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.relay_changed == 'true' - # if: ${{ false }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build Protos RS - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-rs - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay_tls_local: - needs: check_code_changed - if: inputs.run_all == 'true' || needs.check_code_changed.outputs.relay_changed == 'true' - # if: ${{ false }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Build Protos RS - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-rs - - - name: Get Latest Relay Dependencies - run: | - make protos-local - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client-tls 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.relay_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make build - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay - - unit_test_relay_tls: - needs: check_code_changed - if: ${{ false && needs.check_code_changed.outputs.relay_changed == 'true' }} - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Get Latest Relay Dependencies - run: | - cargo update -p nom - cargo update -p lexical-core - working-directory: weaver/core/relay - - - name: Build Image - run: make build - working-directory: weaver/core/relay - - - name: Run Dummy Relay - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin server &> relay-dummy.out & - working-directory: weaver/core/relay - - - name: Run Dummy Driver - run: RELAY_CONFIG=config/Dummy_Relay_tls.toml cargo run --bin dummy-driver &> driver-dummy.out & - working-directory: weaver/core/relay - - - name: Mock Client Test - run: | - echo "Waiting for Dummy Relay and Driver to come up" - sleep 30 - cargo run --bin client-tls 9085 localhost:9085/Dummy_Network/abc:abc:abc:abc - working-directory: weaver/core/relay diff --git a/.github/workflows/weaver_deploy_corda-pkgs.yml b/.github/workflows/weaver_deploy_corda-pkgs.yml deleted file mode 100644 index 74319675cb0..00000000000 --- a/.github/workflows/weaver_deploy_corda-pkgs.yml +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Corda Packages - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-java-kt: - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/common/protos-java-kt - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/common/protos-java-kt - - - publish-interop-app: - if: always() - needs: publish-protos-java-kt - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/core/network/corda-interop-app - - - name: Build - run: make build - working-directory: weaver/core/network/corda-interop-app - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/core/network/corda-interop-app - - publish-sdk: - if: always() - needs: [publish-protos-java-kt, publish-interop-app] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up JDK 17 - uses: actions/setup-java@v3.11.0 - with: - java-version: '17' - distribution: 'adopt' - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/sdks/corda - - - name: Build - run: make build - working-directory: weaver/sdks/corda - - - name: Publish - run: | - make publish > out 2> error - exitStatus=$? - cat out - cat error - (cat error | grep "Received status code 409 from server: Conflict" && exit 0) || exit $exitStatus - working-directory: weaver/sdks/corda - - publish-driver-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-java-kt, publish-interop-app, publish-sdk] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate github.properties - run: | - echo "Using ${GITHUB_ACTOR} user." - echo "username=${GITHUB_ACTOR}" >> github.properties - echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties - echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties - cat github.properties - working-directory: weaver/core/drivers/corda-driver - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "CORDA_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "CORDA_DRIVER_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/drivers/corda-driver - - - name: Build and Push - if: ${{ env.CORDA_DRIVER_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/drivers/corda-driver - - - name: Push latest tag - if: ${{ env.CORDA_DRIVER_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/drivers/corda-driver diff --git a/.github/workflows/weaver_deploy_go-pkgs.yml b/.github/workflows/weaver_deploy_go-pkgs.yml deleted file mode 100644 index 67e2567ffca..00000000000 --- a/.github/workflows/weaver_deploy_go-pkgs.yml +++ /dev/null @@ -1,429 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Go Modules - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-go: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/common/protos-go" >> $GITHUB_ENV - echo "MODULE_DESC=GO Weaver Protos" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/common/protos-go - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/common/protos-go - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "PROTOS_GO_RELEASE=false" >> $GITHUB_ENV) || echo "PROTOS_GO_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/common/protos-go - - - name: Create Release - if: ${{ env.PROTOS_GO_RELEASE == 'true' }} - id: protos-go-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.PROTOS_GO_RELEASE == 'true' }} - run: sleep 300 - - publish-lib-utils: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: publish-protos-go - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Utils Library for Interoperation" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "LIB_UTILS_RELEASE=false" >> $GITHUB_ENV) || echo "LIB_UTILS_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/utils - - - name: Create Release - if: ${{ env.LIB_UTILS_RELEASE == 'true' }} - id: lib-utils-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.LIB_UTILS_RELEASE == 'true' }} - run: sleep 300 - - publish-lib-asset-exchange: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: publish-protos-go - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Library for Asset Exchange" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "LIB_ASSET_EXCHANGE_RELEASE=false" >> $GITHUB_ENV) || echo "LIB_ASSET_EXCHANGE_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange - - - name: Create Release - if: ${{ env.LIB_ASSET_EXCHANGE_RELEASE == 'true' }} - id: lib-asset-exchange-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.LIB_ASSET_EXCHANGE_RELEASE == 'true' }} - run: sleep 300 - - publish-interface-asset-mgmt: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go] - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Asset Management Interface" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Build test - run: go build -v ./... - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "INTERFACE_ASSET_MGMT_RELEASE=false" >> $GITHUB_ENV) || echo "INTERFACE_ASSET_MGMT_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt - - - name: Create Release - if: ${{ env.INTERFACE_ASSET_MGMT_RELEASE == 'true' }} - id: asset-mgmt-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.INTERFACE_ASSET_MGMT_RELEASE == 'true' }} - run: sleep 300 - - publish-interop-cc: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go, publish-lib-utils, publish-lib-asset-exchange] - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Interop Chaincode" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Build test - run: make build - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "INTEROPCC_RELEASE=false" >> $GITHUB_ENV) || echo "INTEROPCC_RELEASE=true" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc/contracts/interop - - - name: Create Release - if: ${{ env.INTEROPCC_RELEASE == 'true' }} - id: interop-cc-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.INTEROPCC_RELEASE == 'true' }} - run: sleep 300 - - publish-go-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go] - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Set up Go - uses: actions/setup-go@v4.0.0 - with: - go-version: '1.20.2' - - - name: Set current date as env - run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV - - - name: Set module tag and description - run: | - echo "MODULE_TAG=weaver/sdks/fabric/go-sdk" >> $GITHUB_ENV - echo "MODULE_DESC=GO Fabric Weaver SDK" >> $GITHUB_ENV - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/sdks/fabric/go-sdk - - - name: Set module version - run: echo "VERSION=v$(cat VERSION)" >> $GITHUB_ENV - working-directory: weaver/sdks/fabric/go-sdk - - - name: Build test - run: make build - working-directory: weaver/sdks/fabric/go-sdk - - - name: Check if release already exists - run: (git ls-remote origin | grep "$MODULE_TAG/$VERSION" && echo "WEAVER_FABRIC_GO_SDK=false" >> $GITHUB_ENV) || echo "WEAVER_FABRIC_GO_SDK=true" >> $GITHUB_ENV - working-directory: weaver/sdks/fabric/go-sdk - - - name: Create Release - if: ${{ env.WEAVER_FABRIC_GO_SDK == 'true' }} - id: go-sdk-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ env.MODULE_TAG }}/${{ env.VERSION }} - release_name: ${{ env.VERSION }} - ${{ env.MODULE_DESC }} - ${{ env.RELEASE_DATE }} - body: | - - Go Module: `github.com/${{ github.repository_owner }}/cacti/${{ env.MODULE_TAG }}` - - Release: ${{ env.VERSION }} - - Readme: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}/README.md). - - Source: [Here](https://github.com/${{ github.repository_owner }}/cacti/blob/${{ env.MODULE_TAG }}/${{ env.VERSION }}/${{ env.MODULE_TAG }}) - draft: false - prerelease: false - - - name: Wait for release to be reflected - if: ${{ env.WEAVER_FABRIC_GO_SDK == 'true' }} - run: sleep 300 - - publish-weaver-fabric-cc-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-go, publish-lib-utils, publish-lib-asset-exchange] - runs-on: ubuntu-22.04 - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3.3.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "WEAVER_FABRIC_CC_PUSH=true" >> $GITHUB_ENV) || echo "WEAVER_FABRIC_CC_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/network/fabric-interop-cc - - - name: Build and Push - if: ${{ env.WEAVER_FABRIC_CC_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/network/fabric-interop-cc - - - name: Push latest tag - if: ${{ env.WEAVER_FABRIC_CC_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/network/fabric-interop-cc diff --git a/.github/workflows/weaver_deploy_node-pkgs.yml b/.github/workflows/weaver_deploy_node-pkgs.yml deleted file mode 100644 index 3dd2964441f..00000000000 --- a/.github/workflows/weaver_deploy_node-pkgs.yml +++ /dev/null @@ -1,240 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Node JS Packages - -env: - NODEJS_VERSION: v18.18.2 - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-js: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Use Protoc 3.15 - run: | - curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip - unzip protoc-3.15.6-linux-x86_64.zip -d protoc - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/common/protos-js - - - name: Build - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make build - working-directory: weaver/common/protos-js - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version --workspaces=false) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "PROTOS_JS_PUBLISH=false" >> $GITHUB_ENV - else - echo "PROTOS_JS_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/common/protos-js - - - name: Publish - if: ${{ env.PROTOS_JS_PUBLISH == 'true' }} - run: | - export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" - make publish - working-directory: weaver/common/protos-js - - publish-fabric-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Build - run: make build - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version --workspaces=false) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "WEAVER_FABRIC_SDK_PUBLISH=false" >> $GITHUB_ENV - else - echo "WEAVER_FABRIC_SDK_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - - name: Publish - if: ${{ env.WEAVER_FABRIC_SDK_PUBLISH == 'true' }} - run: make publish - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - publish-besu-sdk: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Use Node.js ${{ env.NODEJS_VERSION }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ env.NODEJS_VERSION }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/sdks/besu/node - - - name: Build - run: make build - working-directory: weaver/sdks/besu/node - - - name: Check if package already exists - run : | - PKG_NAME=$(node -p "require('./package.json').name") - PUBLISHED_VERSION=$(npm view $PKG_NAME version --workspaces=false) - LOCAL_VERSION=$(node -p "require('./package.json').version") - if [[ "$PUBLISHED_VERSION" == "$LOCAL_VERSION" ]]; then - echo "WEAVER_BESU_SDK_PUBLISH=false" >> $GITHUB_ENV - else - echo "WEAVER_BESU_SDK_PUBLISH=true" >> $GITHUB_ENV - fi - working-directory: weaver/sdks/besu/node - - - name: Publish - if: ${{ env.WEAVER_BESU_SDK_PUBLISH == 'true' }} - run: make publish - working-directory: weaver/sdks/besu/node - - publish-driver-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js, publish-fabric-sdk] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/drivers/fabric-driver - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "FABRIC_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "FABRIC_DRIVER_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/drivers/fabric-driver - - - name: Build and Push - if: ${{ env.FABRIC_DRIVER_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/drivers/fabric-driver - - - name: Push latest tag - if: ${{ env.FABRIC_DRIVER_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/drivers/fabric-driver - - publish-iin-agent-image: - if: ${{ always() && github.repository_owner == 'hyperledger' }} - needs: [publish-protos-js, publish-fabric-sdk] - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate .npmrc - run: | - cp .npmrc.template .npmrc - sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc - cat .npmrc - working-directory: weaver/core/identity-management/iin-agent - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "IINAGENT_PUSH=true" >> $GITHUB_ENV) || echo "IINAGENT_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/identity-management/iin-agent - - - name: Build and Push - if: ${{ env.IINAGENT_PUSH == 'true' }} - run: make push-image - working-directory: weaver/core/identity-management/iin-agent - - - name: Push latest tag - if: ${{ env.IINAGENT_PUSH == 'true' }} - run: make push-image-latest - working-directory: weaver/core/identity-management/iin-agent diff --git a/.github/workflows/weaver_deploy_relay-server.yml b/.github/workflows/weaver_deploy_relay-server.yml deleted file mode 100644 index dfbc52e7a90..00000000000 --- a/.github/workflows/weaver_deploy_relay-server.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: CC-BY-4.0 - -name: Deploy Relay Docker Image - -on: - push: - tags: - - v* - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publish-protos-rs: - if: github.repository_owner == 'hyperledger' - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Install RUST Toolchain minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1.0.6 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - - name: Publish - run: cargo publish --token ${CRATES_TOKEN} - env: - CRATES_TOKEN: ${{ secrets.CARGO_CRATES_IO_TOKEN }} - working-directory: weaver/common/protos-rs/pkg - - publish-relay-image: - if: github.repository_owner == 'hyperledger' - needs: publish-protos-rs - runs-on: ubuntu-22.04 - permissions: - packages: write - contents: read - - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4.1.7 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/relay - - - name: Check if package already exists - run: (make check-if-tag-exists && echo "RELAY_PUSH=true" >> $GITHUB_ENV) || echo "RELAY_PUSH=false" >> $GITHUB_ENV - working-directory: weaver/core/relay - - - name: Build and Push - if: ${{ env.RELAY_PUSH == 'true' }} - run: make push-server - working-directory: weaver/core/relay - - - name: Push latest tag - if: ${{ env.RELAY_PUSH == 'true' }} - run: (cat out | grep "exists") || make push-server-latest - working-directory: weaver/core/relay \ No newline at end of file