Skip to content

chore: update issue templates #3997

chore: update issue templates

chore: update issue templates #3997

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.20.2 ]
mongodb-version: [ 7.0.21 ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.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@2254b4cc4958120e36da3a096e8200dac968be1c # v0.1.4
with:
port: '4222'
- name: Start MongoDB
uses: step-security/mongodb-github-action@ca72004b9c8ad6d9ed996c3174edbe62f9f7424a
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: 20
- 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@681100d67b09305624c089873f12c545ee7cbc24 # v2.23.0
if: always()
with:
files: e2e-tests/cypress/test_results/**/*.xml