Skip to content

Update unit-tests.yml #11

Update unit-tests.yml

Update unit-tests.yml #11

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
concurrency:
group: >-
${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test:
if: ${{ github.repository == 'eprice555/amplify_cicd_test' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: .node-version
cache: npm
- name: Import Secrets
uses: hashicorp/[email protected]
with:
url: https://vault-public-vault-22deb760.8ee49bbe.z1.hashicorp.cloud:8200/
token: ${{ secrets.VAULT_TOKEN }}
namespace: admin/eprice555-test-namespace/
#caCertificate: ${{ secrets.VAULT_CA_CERT }}
secrets: |
secret/data/test/TEST_LOB_API_KEY api-key
# secret/test TEST_CICERO_API_KEY | TEST_CICERO_API_KEY ;
# secret/test TEST_STRIPE_SECRET_KEY | TEST_STRIPE_SECRET_KEY;
# secret/test AUTH0_AUDIENCE | AUTH0_AUDIENCE ;
# secret/test AUTH0_DOMAIN | AUTH0_DOMAIN ;
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test -- server/__tests__/unit/
env:
# Cicero API key
CICERO_API_KEY: ${{ steps.vault.outputs.TEST_CICERO_API_KEY }}
# Test environment Lob API key
LOB_API_KEY: ${{ steps.vault.outputs.TEST_LOB_API_KEY }}
# Stripe test secret key
STRIPE_SECRET_KEY: ${{ steps.vault.outputs.TEST_STRIPE_SECRET_KEY }}
# Auth0 authentication parameters with nonsensical sample values
SERVER_PORT: 8080
CLIENT_ORIGIN_URL: http://localhost:8080
AUTH0_AUDIENCE: ${{ steps.vault.outputs.AUTH0_AUDIENCE }}
AUTH0_DOMAIN: ${{ steps.vault.outputs.AUTH0_DOMAIN }}