Skip to content

Commit f3f1722

Browse files
committed
feat(satp-hermes): added cbdc ci
Signed-off-by: Rodolfo Carapau <[email protected]> feat(satp-hermes): added cbdc ci Signed-off-by: Rodolfo Carapau <[email protected]>
1 parent 3f7d0ef commit f3f1722

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CBDC Tests
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-latest-16-cores
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+
- uses: actions/[email protected]
30+
- name: Use Node.js
31+
uses: actions/[email protected]
32+
with:
33+
node-version: v22.18.0
34+
35+
# Download build artifacts using reusable action
36+
#- name: Download SATP build artifacts
37+
# uses: ./.github/actions/satp-download-build-artifacts
38+
39+
# Download generated artifacts
40+
#- name: Download generated artifacts
41+
# uses: ./.github/actions/satp-download-generated-artifacts
42+
43+
- name: Install dependencies
44+
run: yarn install
45+
46+
- run: ./tools/ci-env-clean-up.sh
47+
48+
- name: Configure and build all packages
49+
run: yarn configure
50+
51+
- name: Run CBDC integration tests (with optional coverage)
52+
run: |
53+
set -euo pipefail
54+
if [ "${{ env.RUN_CODE_COVERAGE }}" = "true" ]; then
55+
echo "Running CBDC integration tests with coverage"
56+
yarn workspace @hyperledger/cactus-example-cbdc-bridging-backend test:integration --coverage --coverageDirectory=./code-coverage-ts/satp-hermes-cbdc || true
57+
else
58+
echo "Running CBDC integration tests without coverage"
59+
yarn workspace @hyperledger/cactus-example-cbdc-bridging-backend test:integration
60+
fi
61+
62+
- name: Upload CBDC integration test report
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: cbdc-integration-junit-report-${{ github.job }}
67+
path: examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml
68+
69+
- name: Check for CBDC junit report
70+
id: check_cbdc_junit
71+
run: |
72+
if [ -f examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml ]; then
73+
echo "found=true" >> "$GITHUB_OUTPUT"
74+
else
75+
echo "found=false" >> "$GITHUB_OUTPUT"
76+
fi
77+
78+
- name: Report CBDC integration test results (annotate)
79+
if: always() && steps.check_cbdc_junit.outputs.found == 'true'
80+
uses: dorny/[email protected]
81+
with:
82+
name: "CBDC Integration Tests"
83+
path: examples/cactus-example-cbdc-bridging-backend/reports/junit/cbdc-bridging-tests-integration.xml
84+
reporter: jest-junit
85+
list-tests: failed
86+
fail-on-error: true
87+
88+
- name: Check for CBDC integration coverage artifacts
89+
id: check_cbdc_coverage
90+
run: |
91+
if [ -d packages/cactus-plugin-satp-hermes/code-coverage-ts ] || [ -f packages/cactus-plugin-satp-hermes/coverage/coverage-final.json ]; then
92+
echo "found=true" >> "$GITHUB_OUTPUT"
93+
else
94+
echo "found=false" >> "$GITHUB_OUTPUT"
95+
fi
96+
97+
- name: Upload CBDC integration coverage (if present)
98+
if: always() && steps.check_cbdc_coverage.outputs.found == 'true'
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: coverage-reports-satp-hermes-${{ github.job }}
102+
path: |
103+
packages/cactus-plugin-satp-hermes/code-coverage-ts/**/

0 commit comments

Comments
 (0)