diff --git a/.github/workflows/lint.js.yml b/.github/workflows/lint.js.yml index d92daa6..2a5ba3c 100644 --- a/.github/workflows/lint.js.yml +++ b/.github/workflows/lint.js.yml @@ -1,9 +1,10 @@ -# 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: Linting -on: [push, pull_request] +on: + push: + branches: [master, main] + pull_request: + types: [opened, synchronize, reopened] permissions: contents: read @@ -12,9 +13,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version: 24 - - run: npm ci - - run: npm run lint + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: 24 + - run: npm ci + - run: npm run lint diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 281a761..4816fe4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,13 +1,9 @@ -# 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: Node.js CI on: push: - branches: [ master ] + branches: [master, main] pull_request: - branches: [ master ] types: [opened, synchronize, reopened] permissions: @@ -15,18 +11,31 @@ permissions: jobs: build: - + needs: [get-lts] runs-on: ubuntu-latest - strategy: matrix: - node-version: [22, 24] + node-version: ${{ fromJson(needs.get-lts.outputs.lts) }} steps: - - uses: actions/checkout@v6 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm test + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test + + get-lts: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - id: get + uses: msimerson/node-lts-versions@v1 + outputs: + active: ${{ steps.get.outputs.active }} + maintenance: ${{ steps.get.outputs.maintenance }} + lts: ${{ steps.get.outputs.lts }} + current: ${{ steps.get.outputs.current }} + min: ${{ steps.get.outputs.min }}