52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
paths:
|
|
- 'CollabTableServer/**'
|
|
- '.github/workflows/tests.yml'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- master
|
|
paths:
|
|
- 'CollabTableServer/**'
|
|
- '.github/workflows/tests.yml'
|
|
workflow_dispatch: {}
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: CollabTableServer
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: CollabTableServer/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: |
|
|
if find src -iname '*.test.ts' -o -iname '*.spec.ts' | grep -q .; then
|
|
echo "Test files found for CollabTableServer — running npm test."
|
|
npm test
|
|
else
|
|
echo "No test suite configured for CollabTableServer yet — skipping."
|
|
exit 0
|
|
fi
|