Skip to content

Commit

Permalink
Add reusable workflows to execute ts unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vithu30 committed Nov 11, 2024
1 parent 2610de7 commit 26a2100
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/execute-typescript-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 🚀 Unit test for Typescript codebase

on:
workflow_call:
inputs:
working-directory:
description: 'Current working directory'
type: string
required: true
runner_label:
description: "Add runners for the GHA"
default: '["self-hosted","platform-eng-ent"]'
type: string
required: false

jobs:
execute-tests:
runs-on:
${{ fromJSON(inputs.runner_label) }}
steps:
- uses: actions/checkout@v4

- name: 🔋 Setup Node.js
working-directory: ${{ inputs.working-directory }}
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: 📥 Install dependencies (all)
working-directory: ${{ inputs.working-directory }}
run: | npm ci
- name: 🧪 Run vitest
working-directory: ${{ inputs.working-directory }}
run: npm test

0 comments on commit 26a2100

Please sign in to comment.