Skip to content

Add GitHub Actions workflows for testing and coverage, and enhance te… #1

Add GitHub Actions workflows for testing and coverage, and enhance te…

Add GitHub Actions workflows for testing and coverage, and enhance te… #1

Workflow file for this run

name: Run Tests
on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main, develop ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Create config file
run: cp config/config.json.example config/config.json
- name: Run tests
run: npm test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-node-${{ matrix.node-version }}
path: |
test-results/
coverage/
retention-days: 30