This commit is contained in:
parent
827014ea49
commit
bef9d30562
@ -1,4 +1,4 @@
|
|||||||
name: Run Jest tests
|
name: Testing
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -13,13 +13,38 @@ jobs:
|
|||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v3
|
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
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run ESLint
|
||||||
run: npm test
|
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