This commit is contained in:
parent
827014ea49
commit
bef9d30562
@ -1,4 +1,4 @@
|
||||
name: Run Jest tests
|
||||
name: Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -13,13 +13,38 @@ jobs:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup up Node
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "npm"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run Tests
|
||||
run: npm test
|
||||
- name: Run ESLint
|
||||
run: npx eslint . --ext .ts
|
||||
|
||||
- name: Run TypeScript Type Checking
|
||||
run: npx tsc --noEmit
|
||||
|
||||
- name: Run Tests with Coverage
|
||||
run: npm test -- --coverage
|
||||
|
||||
- name: Upload Coverage Report
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jest-coverage
|
||||
path: coverage
|
||||
|
||||
- name: Notify on Failure
|
||||
if: failure()
|
||||
run: echo "Tests failed!" && exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user