Ocelot-Social/.github/workflows/maintenance-test.yml

64 lines
1.5 KiB
YAML

name: Maintenance Test
on:
push:
branches: [master]
pull_request:
branches: [master]
defaults:
run:
working-directory: maintenance
jobs:
files-changed:
name: Detect File Changes
runs-on: ubuntu-latest
outputs:
maintenance: ${{ steps.changes.outputs.maintenance }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Check for file changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
test:
name: Unit Tests
if: needs.files-changed.outputs.maintenance == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: 'maintenance/.tool-versions'
cache: 'npm'
cache-dependency-path: maintenance/package-lock.json
- name: Build UI library
working-directory: packages/ui
run: npm ci && npm run build
- name: Install dependencies
run: npm ci
- name: Run tests with coverage
run: npx vitest run --coverage
- name: Upload coverage report
uses: actions/upload-artifact@v7
if: always()
with:
name: maintenance-coverage-report
path: maintenance/coverage/
retention-days: 7