52 lines
986 B
YAML
52 lines
986 B
YAML
---
|
|
name: Build & Test
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
working-directory:
|
|
required: false
|
|
type: string
|
|
default: '.'
|
|
jobs:
|
|
build_and_test:
|
|
name: Build & Test
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ${{ inputs.working-directory }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
|
|
- name: Setup env
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 22
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: ESLint checks
|
|
run: pnpm lint
|
|
|
|
- run: pnpm build
|
|
name: Compile Typescript
|
|
|
|
- run: pnpm test
|
|
name: Run tests
|
|
env:
|
|
CI: true
|
|
|
|
- uses: actions/cache@v3
|
|
id: restore-build
|
|
with:
|
|
path: ./*
|
|
key: ${{ github.sha }}
|