-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (52 loc) · 1.63 KB
/
part_node_test.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: 🟢🏗️🧪📊 Build & run node tests
on:
workflow_call:
inputs:
project:
required: true
description: The project to build
type: string
report:
required: false
default: true
description: Whether to generate the report
type: boolean
permissions:
contents: write
checks: write
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.project }}
steps:
- uses: actions/checkout@v4
- name: 🟢⚙️ Setup node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: ${{ inputs.project }}/package.json
- name: 📊✅ ${{ inputs.project }} Test report
if: ${{ inputs.report }}
uses: ArtiomTr/jest-coverage-report-action@v2
with:
working-directory: ${{ inputs.project }}
test-script: npm run jest
custom-title: Report for ${{ inputs.project }}
- name: 🧪 Testing ${{ inputs.project }}
if: ${{ ! inputs.report }}
run: |
npm ci
npm run jest
- name: 🔍 Run eslint ${{ inputs.project }}
run: npm run eslint:json
continue-on-error: true
- name: 👷 Building ${{ inputs.project }}
run: npm run build > typescript.log
- name: 🔍📝 Annotate ${{ inputs.project }} Linting Results
uses: DerLev/eslint-annotations@v2
with:
eslint-report: ${{ inputs.project }}/js-lint-results-${{ inputs.project }}.json
typescript-log: ${{ inputs.project }}/typescript.log