|
| 1 | +name: CBDC Example CI |
| 2 | +permissions: |
| 3 | + contents: write # Required for test result publishing |
| 4 | + checks: write # Required for test result reports |
| 5 | + packages: write # Required for publishing to GitHub Container Registry |
| 6 | +env: |
| 7 | + NODEJS_VERSION: v22.18.0 |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + branches: [main, satp-dev, satp-stg] |
| 11 | + push: |
| 12 | + branches: [main, satp-dev, satp-stg] |
| 13 | + |
| 14 | +jobs: |
| 15 | + # Test execution jobs: run unit and integration tests in parallel |
| 16 | + run-satp-tests-integration-cbdc: |
| 17 | + runs-on: ubuntu-22.04 |
| 18 | + env: |
| 19 | + FULL_BUILD_DISABLED: true |
| 20 | + JEST_TEST_RUNNER_DISABLED: false |
| 21 | + RUN_CODE_COVERAGE: "true" |
| 22 | + # SATP specific configuration |
| 23 | + SATP_ENABLE_CRASH_RECOVERY: false |
| 24 | + SATP_LOG_LEVEL: DEBUG |
| 25 | + SATP_ENABLE_LOCAL_REPOSITORY: true |
| 26 | + SATP_ENABLE_REMOTE_REPOSITORY: false |
| 27 | + |
| 28 | + steps: |
| 29 | + |
| 30 | + - name: Use Node.js |
| 31 | + |
| 32 | + with: |
| 33 | + node-version: v22.18.0 |
| 34 | + |
| 35 | + - name: Install dependencies |
| 36 | + run: yarn install |
| 37 | + |
| 38 | + - run: ./tools/ci-env-clean-up.sh |
| 39 | + |
| 40 | + - name: Configure and build all packages |
| 41 | + run: yarn configure |
| 42 | + |
| 43 | + - name: Run CBDC integration tests (with optional coverage) |
| 44 | + run: | |
| 45 | + set -euo pipefail |
| 46 | + if [ "${{ env.RUN_CODE_COVERAGE }}" = "true" ]; then |
| 47 | + echo "Running CBDC integration tests with coverage" |
| 48 | + yarn workspace @hyperledger/cactus-example-cbdc-bridging-backend test:integration --coverage --coverageDirectory=./code-coverage-ts/satp-hermes-cbdc || true |
| 49 | + else |
| 50 | + echo "Running CBDC integration tests without coverage" |
| 51 | + yarn workspace @hyperledger/cactus-example-cbdc-bridging-backend test:integration |
| 52 | + fi |
| 53 | +
|
| 54 | + - name: Upload CBDC integration test report |
| 55 | + if: always() |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: cbdc-integration-junit-report-${{ github.job }} |
| 59 | + path: examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml |
| 60 | + |
| 61 | + - name: Check for CBDC junit report |
| 62 | + id: check_cbdc_junit |
| 63 | + run: | |
| 64 | + if [ -f examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml ]; then |
| 65 | + echo "found=true" >> "$GITHUB_OUTPUT" |
| 66 | + else |
| 67 | + echo "found=false" >> "$GITHUB_OUTPUT" |
| 68 | + fi |
| 69 | +
|
| 70 | + - name: Report CBDC integration test results (annotate) |
| 71 | + if: always() && steps.check_cbdc_junit.outputs.found == 'true' |
| 72 | + |
| 73 | + with: |
| 74 | + name: "CBDC Integration Tests" |
| 75 | + path: examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml |
| 76 | + reporter: jest-junit |
| 77 | + list-tests: failed |
| 78 | + fail-on-error: true |
| 79 | + |
| 80 | + - name: Check for CBDC integration coverage artifacts |
| 81 | + id: check_cbdc_coverage |
| 82 | + run: | |
| 83 | + if [ -d packages/cactus-plugin-satp-hermes/code-coverage-ts ] || [ -f packages/cactus-plugin-satp-hermes/coverage/coverage-final.json ]; then |
| 84 | + echo "found=true" >> "$GITHUB_OUTPUT" |
| 85 | + else |
| 86 | + echo "found=false" >> "$GITHUB_OUTPUT" |
| 87 | + fi |
| 88 | +
|
| 89 | + - name: Upload CBDC integration coverage (if present) |
| 90 | + if: always() && steps.check_cbdc_coverage.outputs.found == 'true' |
| 91 | + uses: actions/upload-artifact@v4 |
| 92 | + with: |
| 93 | + name: coverage-reports-satp-hermes-${{ github.job }} |
| 94 | + path: | |
| 95 | + packages/cactus-plugin-satp-hermes/code-coverage-ts/**/ |
0 commit comments