Skip to content

Update unit-tests.yml #28

Update unit-tests.yml

Update unit-tests.yml #28

Workflow file for this run

name: Unit Tests
on:
workflow_dispatch:
pull_request:
permissions:
contents: read
# id-token: write
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
permissions:
contents: read
id-token: write
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: Retrieve secret from Vault
uses: hashicorp/[email protected]
with:
method: jwt
url: https://vault-public-vault-22deb760.8ee49bbe.z1.hashicorp.cloud:8200/
namespace: admin/eprice555-test-namespace
role: demo
secrets: |
secret/data/test/TEST_LOB_API_KEY api-key | TEST_LOB_API_KEY ;
secret/data/test/CICERO_API_KEY api-key | CICERO_API_KEY ;
secret/data/test/TEST_STRIPE_SECRET_KEY api-key | TEST_STRIPE_SECRET_KEY ;
secret/data/test/AUTH0_AUDIENCE api-key | AUTH0_AUDIENCE ;
secret/data/test/AUTH0_DOMAIN api-key | AUTH0_DOMAIN ;
# - name: Import Secrets
# uses: hashicorp/[email protected]
# with:
# url: https://vault-public-vault-22deb760.8ee49bbe.z1.hashicorp.cloud:8200/
# role: demo
# method: jwt
# namespace: admin/eprice555-test-namespace/
# #caCertificate: ${{ secrets.VAULT_CA_CERT }}
# secrets: |
# secret/data/test/TEST_LOB_API_KEY api-key | TEST_LOB_API_KEY ;
# secret/data/test/CICERO_API_KEY api-key | CICERO_API_KEY ;
# secret/data/test/TEST_STRIPE_SECRET_KEY api-key | TEST_STRIPE_SECRET_KEY ;
# secret/data/test/AUTH0_AUDIENCE api-key | AUTH0_AUDIENCE ;
# secret/data/test/AUTH0_DOMAIN api-key | AUTH0_DOMAIN ;
# 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: ${{ env.CICERO_API_KEY }}
LOB_API_KEY: ${{ env.LOB_API_KEY }}
STRIPE_SECRET_KEY: ${{ env.STRIPE_SECRET_KEY }}
SERVER_PORT: 8080
CLIENT_ORIGIN_URL: http://localhost:8080
AUTH0_AUDIENCE: ${{ env.AUTH0_AUDIENCE }}
AUTH0_DOMAIN: ${{ env.AUTH0_DOMAIN }}