name: Run unit tests
#
# PROCESS
#
# 1. Checkout code
# 2. Install dependencies & build project
# 3. Run linting
# 4. Run unit tests
#
# USAGE
#
# NOTE: meant to be called by ./.github/workflows/on-pr-code-update.yml when a PR is opened or updated,
# or by ./.github/workflows/make-release.yml when a release is made.
#
on:
workflow_call:
permissions:
contents: read
jobs:
code-quality:
runs-on: ubuntu-latest
env:
NODE_ENV: dev
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup NodeJS
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
cache: "npm"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5
with:
nodeVersion: 24
- name: Linting
run: npm run lint
- name: Unit tests
run: |
npm run test:unit:coverage