# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Build master

on:
    push:
        branches: [master]
    pull_request:
        branches: [master]

jobs:
    build:
        runs-on: ubuntu-latest

        strategy:
            matrix:
                node-version: [20.x, 22.x, 24.x]

        steps:
            - name: Checkout
              uses: actions/checkout@v2

            - name: Use Node.js ${{ matrix.node-version }}
              uses: actions/setup-node@v1
              with:
                  node-version: ${{ matrix.node-version }}

            - name: Install dependencies
              run: npm ci

            - name: Lint
              run: npm run lint

            - name: Build
              run: npm run build

            - name: Test
              run: npm run test

            - name: Code Coverage Summary Report
              uses: irongut/CodeCoverageSummary@v1.3.0
              with:
                  filename: coverage/cobertura-coverage.xml
                  format: markdown
