mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2026-04-23 16:42:54 -04:00
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: Run Tests
|
|
|
|
on:
|
|
push:
|
|
branches: ["main", "master"]
|
|
pull_request:
|
|
branches: ["main", "master"]
|
|
|
|
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: Use 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: Run tests with coverage
|
|
run: npm test -- --coverage || npm test
|
|
env:
|
|
CI: true
|
|
|
|
- name: Upload coverage reports
|
|
if: success()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-node-${{ matrix.node-version }}
|
|
path: |
|
|
packages/*/coverage/
|
|
coverage/
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-results-node-${{ matrix.node-version }}
|
|
path: |
|
|
packages/*/test-results/
|
|
test-results/
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
- name: Run NPM build to check there are no build errors
|
|
run: npm run build
|