generated from ryansonshine/typescript-npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (32 loc) · 883 Bytes
/
unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Unit Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-unit
cancel-in-progress: true
steps:
- uses: actions/checkout@master
- name: Get file permission
run: chmod -R 777 .
- name: Try Cached Node Modules
id: cache-node-modules
uses: actions/cache@master
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Node Modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Test Code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run test
- name: Jest coverage comment
uses: MishaKav/jest-coverage-comment@main