Skip to content

Commit

Permalink
Add npm.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fumikito committed Aug 1, 2023
1 parent db06003 commit 316ce29
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: NPM syntax check CI

on:
workflow_call:
inputs:
node_version:
description: 'Node version to Run test'
default: 14
required: false
command:
description: 'Command in package.json to run syntax check. Default "lint"'
default: "lint"
required: false
type: string
package:
description: 'Command in package.json to build files. Default "" and not executed if empty.'
default: ''
required: false
type: string

jobs:
npm-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}

- name: Install NPM Packages
run: npm install

- name: Run Syntax Check
run: npm run ${{ inputs.command }}

- name: Check build script to check if compilation success
if: '' != inputs.package
run: npm run ${{ inputs.package }}

0 comments on commit 316ce29

Please sign in to comment.