Skip to content

Update feature-request-enhance.yml #160

Update feature-request-enhance.yml

Update feature-request-enhance.yml #160

Workflow file for this run

name: Test and Coverage
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
test-with-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: npm install
- name: Install coverage tool
run: npm install --save-dev c8
- name: Create config file
run: |
if [ ! -f config/config.json ]; then
cp config/config.json.example config/config.json
fi
- name: Run tests with coverage
run: npx c8 --reporter=text --reporter=lcov npm test
env:
NODE_ENV: test
- name: Display coverage summary
if: always()
run: npx c8 report --reporter=text-summary
- name: Comment coverage on PR
if: github.event_name == 'pull_request'
run: |
echo "Coverage report generated"
npx c8 report --reporter=text