Skip to content

feat(accessLogsExport): create new endpoints TASK-1147  (#5304) #6940

feat(accessLogsExport): create new endpoints TASK-1147  (#5304)

feat(accessLogsExport): create new endpoints TASK-1147  (#5304) #6940

Workflow file for this run

name: npm-test
on:
push:
branches: [ main ]
workflow_call:
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version:
- '16.15.0' # prior pinned Node version supported by kpi
- '20.17.0' # version pinned for kpi release
- '20' # latest available v20
- '22' # latest available v22
fail-fast: false # Let each job finish
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: true # download newer semver match if available
cache: 'npm'
- name: Identify resolved node version
id: resolved-node-version
run: echo "NODE_VERSION=$(node --version)" >> "$GITHUB_OUTPUT"
- name: Add "Node ${{ steps.resolved-node-version.outputs.NODE_VERSION }}" to summary
run: echo "${{ matrix.node-version }} → **${{ steps.resolved-node-version.outputs.NODE_VERSION }}**" >> "$GITHUB_STEP_SUMMARY"
# Cache: Use cache for node_modules
# Keyed on os, node version, package-lock, and patches
- uses: actions/cache@v4
name: Check for cached node_modules
id: cache-nodemodules
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-v${{ steps.resolved-node-version.outputs.NODE_VERSION }}-${{ hashFiles('**/package-lock.json', 'patches/**/*.patch') }}
# Cache hit: If the cache key matches,
# /node_modules/ will have been copied from a previous run.
# (Run the post-install step, `npm run copy-fonts`)
- name: Run copy-fonts (if using cached node_modules)
if: steps.cache-nodemodules.outputs.cache-hit == 'true'
run: npm run copy-fonts
# Cache miss: If node_modules has not been cached,
# `npm install`
# (This includes `npm run copy-fonts` as post-install step)
- name: Install JavaScript dependencies (npm install)
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm install
# Check that the full build succeeds
- name: Build Prod
run: SKIP_TS_CHECK=true npm run build
# Check for TypeScript errors
- name: Check TypeScript
run: npm run check-types
# Check for ESLint messages (errors only)
- name: Check ESLint, errors only
run: npm run lint -- --quiet
# Run the Unit test suite (formbuilder and helpers)
- name: Run unit tests and xlform tests
run: npx jest --config ./jsapp/jest/unit.config.ts --ci
# Run the Jest test suite (React components)
- name: Run component tests with Jest
run: npx jest --config ./jsapp/jest/jest.config.ts --ci