Skip to content

feat: Create Store Presentation #716

feat: Create Store Presentation

feat: Create Store Presentation #716

name: Performance tests
concurrency:
group: ${{ github.head_ref }}${{ github.ref }}-performance-tests
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:
env:
BENCHMARKING_DIR: "tests/performance-tests/atala-performance-tests-k6"
NODE_AUTH_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
jobs:
run-e2e-tests:
name: "Run performance tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]
- name: Setup Gradle
uses: gradle/[email protected]
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
- uses: KengoTODA/actions-setup-docker-compose@v1
name: Install `docker-compose`
with:
version: '2.14.2'
- name: Build local version of PRISM Agent
env:
ENV_FILE: "infrastructure/local/.env"
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
run: |
sbt docker:publishLocal
PRISM_AGENT_VERSION=$(cut version.sbt -d '=' -f2 | tr -d '" ')
sed -i.bak "s/PRISM_AGENT_VERSION=.*/PRISM_AGENT_VERSION=${PRISM_AGENT_VERSION}/" "${ENV_FILE}" && rm -f "${ENV_FILE}.bak"
cat "${ENV_FILE}"
- name: Start services for issuer
env:
PORT: 8080
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5432
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p issuer"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for holder
env:
PORT: 8090
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5433
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p holder"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for verifier
env:
PORT: 8100
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5434
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p verifier"
up-flags: "--wait"
down-flags: "--volumes"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: "https://npm.pkg.github.com"
scope: 'input-output-hk'
- name: Install dependencies
uses: borales/[email protected]
with:
cmd: install
dir: ${{ env.BENCHMARKING_DIR }}
- name: Compile tests to JS
uses: borales/[email protected]
with:
cmd: webpack
dir: ${{ env.BENCHMARKING_DIR }}
- name: All Smoke Tests
env:
ISSUER_AGENT_API_KEY: default
HOLDER_AGENT_API_KEY: default
VERIFIER_AGENT_API_KEY: default
run: |
# Have to use manual download because GitHub action doesnt support localhost execution
curl https://github.com/grafana/k6/releases/download/v0.45.0/k6-v0.45.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
ls -la
./k6 run -e SCENARIO_LABEL=create-prism-did-smoke ${{ env.BENCHMARKING_DIR }}/dist/create-prism-did-test.js
./k6 run -e SCENARIO_LABEL=credential-offer-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-offer-test.js
./k6 run -e SCENARIO_LABEL=credential-schema-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-schema-test.js
./k6 run -e SCENARIO_LABEL=did-publishing-smoke ${{ env.BENCHMARKING_DIR }}/dist/did-publishing-test.js
./k6 run -e SCENARIO_LABEL=connection-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/connection-flow-test.js
./k6 run -e SCENARIO_LABEL=issuance-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/issuance-flow-test.js
./k6 run -e SCENARIO_LABEL=present-proof-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/present-proof-flow-test.js