diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a8db749e20e..5e31531a2b5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,8 @@ env: NODEJS_VERSION: v18.18.2 RUN_TRIVY_SCAN: true + RUN_CODE_COVERAGE: true + RUN_COVERAGE_REPORT: false jobs: ActionLint: uses: ./.github/workflows/actionlint.yaml @@ -354,6 +356,8 @@ jobs: 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_PATTERN: ./packages/cactus-api-client/src/test/typescript/integration/default-consortium-provider.test.ts TAPE_TEST_RUNNER_DISABLED: false needs: build-dev @@ -375,6 +379,13 @@ jobs: ${{ 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/**/coverage-final.json + cactus-cmd-api-server: continue-on-error: false needs: @@ -386,6 +397,8 @@ jobs: 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/integration/plugin-import-from-github.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/plugin-import-without-install.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/integration/remote-plugin-imports.test.ts,./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-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-consortium-manual.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-keychain-memory.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-fabric-0-7-0.test.ts,./packages/cactus-cmd-api-server/src/test/typescript/unit/plugins/install-basic-plugin-ledger-connector-quorum-0-7-0.test.ts} TAPE_TEST_RUNNER_DISABLED: false @@ -407,6 +420,12 @@ jobs: ${{ 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/**/coverage-final.json - name: Ensure .tmp Directory Exists run: mkdir -p .tmp/benchmark-results/cmd-api-server/ @@ -445,6 +464,8 @@ jobs: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-cmd-socketio-server/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-cmd-socketio-server + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_RUNNER_DISABLED: true needs: build-dev runs-on: ubuntu-22.04 @@ -465,6 +486,12 @@ jobs: ${{ 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/**/coverage-final.json cactus-common: continue-on-error: false @@ -473,6 +500,8 @@ jobs: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-common/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cactus-common + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_PATTERN: '--files={./packages/cactus-common/src/test/typescript/unit/key-converter.test.ts,./packages/cactus-common/src/test/typescript/unit/logging/logger.test.ts}' TAPE_TEST_RUNNER_DISABLED: false needs: build-dev @@ -494,12 +523,21 @@ jobs: ${{ 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/**/coverage-final.json + 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 @@ -519,12 +557,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -544,12 +591,22 @@ jobs: 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/**/coverage-final.json + 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 @@ -570,12 +627,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -595,6 +661,13 @@ jobs: 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/**/coverage-final.json + ce-carbon-accounting-frontend: continue-on-error: false env: @@ -602,6 +675,8 @@ jobs: 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 @@ -621,6 +696,12 @@ jobs: 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/**/coverage-final.json ce-supply-chain-backend: continue-on-error: false env: @@ -629,6 +710,8 @@ jobs: 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 @@ -649,12 +732,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -674,6 +766,13 @@ jobs: 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/**/coverage-final.json + ce-supply-chain-frontend: continue-on-error: false env: @@ -681,6 +780,8 @@ jobs: 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 @@ -700,12 +801,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -725,12 +835,21 @@ jobs: 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/**/coverage-final.json + 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: false @@ -752,12 +871,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -777,12 +905,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -802,12 +939,21 @@ jobs: 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/**/coverage-final.json + 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: true + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cp-keychain-aws-sm + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_PATTERN: '--files={./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/openapi/openapi-validation.test.ts,./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,./packages/cactus-plugin-keychain-aws-sm/src/test/typescript/integration/plugin-keychain-aws-sm.test.ts}' TAPE_TEST_RUNNER_DISABLED: false needs: build-dev @@ -828,12 +974,21 @@ jobs: 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/**/coverage-final.json + 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 @@ -854,12 +1009,20 @@ jobs: 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/**/coverage-final.json 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_PATTERN: '--files={./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/openapi/openapi-validation.test.ts,./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-factory-keychain.test.ts,./packages/cactus-plugin-keychain-google-sm/src/test/typescript/integration/plugin-keychain-google-sm.test.ts}' TAPE_TEST_RUNNER_DISABLED: false needs: build-dev @@ -880,12 +1043,20 @@ jobs: 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/**/coverage-final.json 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 @@ -905,12 +1076,20 @@ jobs: 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/**/coverage-final.json 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: false needs: build-dev @@ -931,12 +1110,20 @@ jobs: 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/**/coverage-final.json 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 @@ -957,6 +1144,12 @@ jobs: 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/**/coverage-final.json cpl-connector-aries: continue-on-error: false needs: @@ -967,6 +1160,8 @@ jobs: 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: @@ -984,6 +1179,12 @@ jobs: 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/**/coverage-final.json cpl-connector-besu: permissions: write-all continue-on-error: false @@ -995,6 +1196,8 @@ jobs: 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/deploy-contract-from-json.test.ts,./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-cactus.test.ts,./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-deploy-contract-from-json.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 @@ -1015,7 +1218,13 @@ jobs: 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/**/coverage-final.json + - name: Ensure .tmp Directory Exists run: mkdir -p .tmp/benchmark-results/plugin-ledger-connector-besu/ @@ -1053,6 +1262,8 @@ jobs: 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 @@ -1075,6 +1286,12 @@ jobs: 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/**/coverage-final.json cpl-connector-corda: continue-on-error: false needs: @@ -1085,6 +1302,8 @@ jobs: 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/deploy-cordapp-jars-to-nodes-v4.7.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8-express.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes.test.ts,./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/jvm-kotlin-spring-server-v4.7.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/jvm-kotlin-spring-server-v4.8.test.ts,./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/openapi/openapi-validation.test.ts} TAPE_TEST_RUNNER_DISABLED: false @@ -1105,6 +1324,12 @@ jobs: 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-26 + path: ./code-coverage-ts/**/coverage-final.json plc-fabric-0: needs: @@ -1119,6 +1344,8 @@ jobs: 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_PATTERN: "" TAPE_TEST_RUNNER_DISABLED: true runs-on: ubuntu-22.04 @@ -1138,6 +1365,12 @@ jobs: 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/**/coverage-final.json plc-fabric-1: needs: @@ -1542,6 +1775,8 @@ jobs: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts JEST_TEST_RUNNER_DISABLED: true + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-go-ethereum-socketio + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_RUNNER_DISABLED: true needs: build-dev runs-on: ubuntu-22.04 @@ -1561,6 +1796,12 @@ jobs: 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/**/coverage-final.json cplc-iroha2: continue-on-error: false needs: @@ -1571,6 +1812,8 @@ jobs: 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: @@ -1589,6 +1832,12 @@ jobs: 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-29 + path: ./code-coverage-ts/**/coverage-final.json cplc-ethereum: continue-on-error: false needs: @@ -1599,6 +1848,8 @@ jobs: 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: @@ -1616,6 +1867,12 @@ jobs: 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/**/coverage-final.json cplc-quorum: continue-on-error: false needs: @@ -1626,6 +1883,8 @@ jobs: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/cplc-quorum + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_PATTERN: >- --files={./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/openapi/openapi-validation-no-keychain.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/openapi/openapi-validation.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-deploy-contract-from-json-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-invoke-contract-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v2.3.0-invoke-contract-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-deploy-contract-from-json-json-object.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-invoke-contract-json-object-endpoints.test.ts,./packages/cactus-plugin-ledger-connector-quorum/src/test/typescript/integration/plugin-ledger-connector-quorum/deploy-contract/v21.4.1-invoke-contract-json-object.test.ts} TAPE_TEST_RUNNER_DISABLED: false @@ -1646,10 +1905,16 @@ jobs: 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/**/coverage-final.json - name: Build an image from Dockerfile run: DOCKER_BUILDKIT=1 docker build . -f ./packages/cactus-plugin-ledger-connector-quorum/Dockerfile -t plugin-ledger-connector-quorum - - if: ${{ env.RUN_TRIVY_SCAN == 'true' }} + - if: ${{ env.RUN_CODE_COVERAGE == 'true' }} name: Run Trivy vulnerability scan for plugin-ledger-connector-quorum uses: aquasecurity/trivy-action@0.19.0 with: @@ -1665,6 +1930,8 @@ jobs: 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 @@ -1683,12 +1950,20 @@ jobs: 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/**/coverage-final.json 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 @@ -1710,12 +1985,20 @@ jobs: 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/**/coverage-final.json 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 @@ -1735,12 +2018,20 @@ jobs: 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/**/coverage-final.json 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 @@ -1761,6 +2052,12 @@ jobs: 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/**/coverage-final.json # cactus-plugin-satp-hermes: # continue-on-error: false # env: @@ -1794,6 +2091,8 @@ jobs: 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 @@ -1813,12 +2112,20 @@ jobs: 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/**/coverage-final.json 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 @@ -1838,6 +2145,13 @@ jobs: 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/**/coverage-final.json + ct-cmd-api-server: continue-on-error: false needs: @@ -1848,6 +2162,8 @@ jobs: 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_PATTERN: ./packages/cactus-test-cmd-api-server/src/test/typescript/integration/plugin-import-with-npm-install-version-selection.test.ts TAPE_TEST_RUNNER_DISABLED: false runs-on: ubuntu-22.04 @@ -1867,12 +2183,20 @@ jobs: 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/**/coverage-final.json 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 @@ -1892,12 +2216,20 @@ jobs: 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/**/coverage-final.json 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 + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-consortium-manual + JEST_TEST_CODE_COVERAGE_ENABLED: true 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 needs: build-dev @@ -1918,12 +2250,20 @@ jobs: 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/**/coverage-final.json ctp-htlc-eth-besu: continue-on-error: false env: 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 @@ -1944,6 +2284,12 @@ jobs: 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/**/coverage-final.json - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 @@ -1957,6 +2303,8 @@ jobs: 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 @@ -1978,6 +2326,12 @@ jobs: 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/**/coverage-final.json ctp-ledger-connector-besu: continue-on-error: false needs: @@ -1988,6 +2342,8 @@ jobs: 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-balance-endpoint.test.ts,./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-balance-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-block-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-get-past-logs-endpoint.test.ts,./packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-validator-besu/v21-sign-transaction-endpoint.test.ts} TAPE_TEST_RUNNER_DISABLED: false @@ -2008,6 +2364,12 @@ jobs: 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/**/coverage-final.json ctp-ledger-connector-quorum: continue-on-error: false needs: @@ -2018,6 +2380,8 @@ jobs: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-test-plugin-ledger-connector-quorum/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts JEST_TEST_RUNNER_DISABLED: false + JEST_TEST_COVERAGE_PATH: ./code-coverage-ts/ctp-ledger-connector-quorum + JEST_TEST_CODE_COVERAGE_ENABLED: true TAPE_TEST_RUNNER_DISABLED: true runs-on: ubuntu-22.04 steps: @@ -2036,12 +2400,20 @@ jobs: 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/**/coverage-final.json 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 @@ -2063,6 +2435,12 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - 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/**/coverage-final.json cactus-test-tooling: continue-on-error: false needs: @@ -2073,6 +2451,8 @@ jobs: 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/postgres/postgres-test-container/constructor-validates-options.test.ts,./packages/cactus-test-tooling/src/test/typescript/integration/quorum/quorum-test-ledger/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 @@ -2093,12 +2473,20 @@ jobs: 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/**/coverage-final.json 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 @@ -2118,6 +2506,12 @@ jobs: 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/**/coverage-final.json ghcr-besu-all-in-one: runs-on: ubuntu-22.04 steps: @@ -2303,6 +2697,63 @@ jobs: - name: ghcr.io/hyperledger/cactus-quorum-multi-party-all-in-one run: DOCKER_BUILDKIT=1 docker build ./tools/docker/quorum-multi-party-all-in-one/ -f ./tools/docker/quorum-multi-party-all-in-one/Dockerfile -t cactus-quorum-multi-party-all-in-one + - name: Run Trivy vulnerability scan for cactus-quorum-multi-party-all-in-one + uses: aquasecurity/trivy-action@0.11.2 + with: + image-ref: 'cactus-quorum-multi-party-all-in-one' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + generate_coverage_report: + runs-on: ubuntu-22.04 + if: env.RUN_CODE_COVERAGE == 'true' + steps: + + - name: Use Node.js ${{ env.NODEJS_VERSION }} + uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ env.NODEJS_VERSION }} + + - uses: actions/checkout@v4.1.1 + + - id: yarn-cache + name: Restore Yarn Cache + uses: actions/cache@v4.0.1 + with: + key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} + path: ./.yarn/ + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} + + - name: Install istanbul-merge + run: yarn add istanbul-merge --dev + + - name: Run Configure + run: npm run configure + + - name: Download coverage reports + uses: actions/download-artifact@v4.1.1 + with: + path: ./code-coverage-ts/ + + - name: Display structure of downloaded files + run: ls -R ./code-coverage-ts/**/**/coverage-final.json + + - name: Merge coverage reports + run: npx istanbul-merge --out coverage.json ./code-coverage-ts/coverage-reports-*/*/coverage-final.json + + - name: Generate HTML report + run: npx istanbul report --include coverage.json --dir cacti html + + - name: Output text report + run: npx istanbul report --include coverage.json --dir cacti text + + - name: Output text-summary report + run: npx istanbul report --include coverage.json --dir cacti text-summary + + name: Cactus_CI 'on': pull_request: diff --git a/packages/cactus-cmd-api-server/Dockerfile b/packages/cactus-cmd-api-server/Dockerfile index e84eade18b1..946f26c31ad 100644 --- a/packages/cactus-cmd-api-server/Dockerfile +++ b/packages/cactus-cmd-api-server/Dockerfile @@ -5,7 +5,7 @@ SHELL ["/bin/bash", "-c"] ARG APP=/usr/src/app/ ENV APP_USER=appuser -# GUI: 3000, API: 4000, gRPC 5000 +# GUI: 3000, API: 4000, gRPC 50008 EXPOSE 3000 4000 5000 RUN groupadd --gid 1000 appuser \ diff --git a/tools/ci.sh b/tools/ci.sh index 305f8d424c4..e21224abcc4 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -146,6 +146,8 @@ function mainTask() if [ "${JEST_TEST_RUNNER_DISABLED:-false}" = "true" ]; then echo "$(date +%FT%T%z) [CI] Jest test runner disabled. Skipping..." + elif [ "${JEST_TEST_CODE_COVERAGE_ENABLED:-true}" = "true" ]; then + yarn jest $JEST_TEST_PATTERN --coverage --coverageDirectory=$JEST_TEST_COVERAGE_PATH else yarn test:jest:all $JEST_TEST_PATTERN fi