Skip to content

Commit 2a80c5b

Browse files
authored
Create unit-test.yaml
1 parent 4686070 commit 2a80c5b

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/unit-test.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Unit Test Check
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- package.json
10+
- apps/**
11+
- '!apps/docs/**'
12+
- libraries/**
13+
14+
pull_request:
15+
paths:
16+
- package.json
17+
- apps/**
18+
- '!apps/docs/**'
19+
- libraries/**
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
matrix:
27+
node-version: ['20.17.0']
28+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
cache: 'npm'
37+
cache-dependency-path: |
38+
**/package-lock.json
39+
40+
# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
41+
- uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.npm
45+
${{ github.workspace }}/.next/cache
46+
47+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
48+
restore-keys: |
49+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
50+
51+
- run: npm run test

0 commit comments

Comments
 (0)