Skip to content

Commit

Permalink
Add reusable node workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Oct 4, 2023
1 parent 8543ec8 commit 2f10faf
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and test Node.js

on: []

jobs:
matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: matrix
uses: nasa-gcn/node-auto-matrix@main
outputs:
nodeVersion: ${{ steps.matrix.outputs.nodeVersion }}
runsOn: ${{ steps.matrix.outputs.runsOn }}
build:
needs: matrix
strategy:
matrix:
nodeVersion: ${{ fromJson(needs.matrix.outputs.nodeVersion) }}
runsOn: ${{ fromJson(needs.matrix.outputs.runsOn) }}
runs-on: ${{ matrix.runsOn }}
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion }}
- name: NPM Install
run: npm ci
- name: Run eslint linter
run: npx eslint --max-warnings 0 .
- name: Run TypeScript compiler
run: npm run typecheck
- name: Run Prettier code style checks
run: npx prettier -c .
# Skip prettier checks on Windows due to line endings.
# See https://prettier.io/docs/en/options.html#end-of-line
if: ${{ runner.os != 'Windows' }}
- name: Run unit tests
run: npm run test-coverage
- name: Upload to Codecov.io
uses: codecov/codecov-action@v3

0 comments on commit 2f10faf

Please sign in to comment.