Skip to content

docs: update swagger examples for analytics endpoints #3605

docs: update swagger examples for analytics endpoints

docs: update swagger examples for analytics endpoints #3605

name: Guardian CI API Tests (After commit)
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
buildAndTest:
name: Build and Test
runs-on: guardian-linux-medium
services:
cache:
image: registry.redict.io/redict
ports:
- 6379:6379
strategy:
matrix:
node-version: [ 20.19.5 ]
mongodb-version: [ 7.0.21 ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{ matrix.node-version }}
- name: Setup Yarn
uses: Borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
with:
cmd: install
- name: Install dependencies
run: yarn install
- name: Build packages
run: |
pushd interfaces
yarn run build
popd
pushd common
yarn run build
popd
pushd notification-service
yarn run build
popd
pushd logger-service
yarn run build
popd
pushd auth-service
yarn run build
popd
pushd queue-service
yarn run build
popd
pushd topic-listener-service
yarn run build
popd
pushd guardian-service
yarn run build
popd
pushd policy-service
yarn run build
popd
pushd worker-service
yarn run build
popd
pushd api-gateway
yarn run build
popd
- name: Start NatsMQ
uses: step-security/nats-action@4c3a6529e7e03047bc23f178a4b47ea8f901d215 # v0.1.3
with:
port: '4222'
- name: Start MongoDB
uses: step-security/mongodb-github-action@7263579321780efeb685cdd6a2a356aad687ebab # v1.12.3
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Run Guardian
run: |
pushd notification-service
npm start &
sleep 20
popd
pushd logger-service
npm start &
sleep 20
popd
pushd auth-service
npm start &
sleep 20
popd
pushd guardian-service
npm start &
sleep 20
popd
pushd policy-service
npm start &
sleep 20
popd
pushd queue-service
npm start &
sleep 20
popd
pushd topic-listener-service
npm start &
sleep 20
popd
pushd worker-service
npm start &
npm start &
npm start &
npm start &
npm start &
sleep 20
popd
pushd api-gateway
npm start &
sleep 20
popd
sleep 60
env:
CI: true
NODE_OPTIONS: '--openssl-legacy-provider'
OPERATOR_ID: ${{ secrets.CI_HEDERA_ACCOUNT }}
OPERATOR_KEY: ${{ secrets.CI_HEDERA_PRIV_KEY }}
JWT_PRIVATE_KEY: ${{ secrets.CI_JWT_PRIVATE_KEY }}
JWT_PUBLIC_KEY: ${{ secrets.CI_JWT_PUBLIC_KEY }}
SERVICE_JWT_PUBLIC_KEY_ALL: ${{ secrets.CI_JWT_PUBLIC_KEY }}
SERVICE_JWT_SECRET_KEY_ALL: ${{ secrets.CI_JWT_PRIVATE_KEY }}
IPFS_NODE_ADDRESS: http://localhost:5001
IPFS_PROVIDER: web3storage
IPFS_PUBLIC_GATEWAY: https://dweb.link/ipfs/${cid}
IPFS_STORAGE_KEY: ${{ secrets.E2E_IPFS_STORAGE_KEY }}
IPFS_STORAGE_PROOF: ${{ secrets.E2E_IPFS_STORAGE_PROOF }}
ACCESS_TOKEN_UPDATE_INTERVAL: 600000
MIN_PASSWORD_LENGTH: 4
PASSWORD_COMPLEXITY: easy
INITIAL_BALANCE: 2
INITIAL_STANDARD_REGISTRY_BALANCE: 13
- name: Build Cypress Docker image
run: docker build -t cypress-runner ./e2e-tests
- name: Run Cypress Tests in Docker
run: |
docker run --network host --name cypress-test-run \
-e CYPRESS_portApi=3002 \
-e CYPRESS_operatorId=${{ secrets.CI_HEDERA_ACCOUNT }} \
-e CYPRESS_operatorKey=${{ secrets.CI_HEDERA_PRIV_KEY }} \
-e CYPRESS_grepTags=smoke \
-e CYPRESS_grepFilterSpecs=true \
cypress-runner \
--browser chrome
- name: Copy test results from Docker container
if: always()
run: |
docker cp cypress-test-run:/e2e/cypress/test_results ./e2e-tests/cypress/test_results || true
- name: Cleanup Docker resources
if: always()
run: |
docker rm -f cypress-test-run || true
- name: Publish API Test Results
uses: step-security/publish-unit-test-result-action@7dff603bf17ef13dee847147bef8d7cd1728b566 # v2.22.0
if: always()
with:
files: e2e-tests/cypress/test_results/**/*.xml