Tallangroberg/initial testing #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run-unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: '18.x' | |
- name: Cache Dependencies | |
uses: actions/cache@v2 | |
id: npm-cache | |
with: | |
path: node_modules | |
key: npm-${{ hashFiles('package-lock.json') }} | |
restore-keys: npm- | |
- name: Install Dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
run: npm i | |
- name: Run unit tests | |
run: npm run test-unit | |