44 lines
939 B
YAML
44 lines
939 B
YAML
name: Testing
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
run-tests:
|
|
runs-on: ubuntu-22.04
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- 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 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
|