Fix syntax in feature-request-enhance.yml #156
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |