Files
pyscript/.github/workflows/lint.yml
Peter W b84017d191 CI Improvements; more focused runs and best practices (#236)
* add path filtering

* small improvements for clarity, more focused run triggers, best practices

* formatting

* add js linting to pre-commit

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml
2022-05-06 09:46:59 -05:00

42 lines
1.0 KiB
YAML

name: Lint
on:
push: # Only run on merges into master that modify files under pyscriptjs/
branches:
- main
pull_request: # Run on any PR that modifies files in pyscriptjs/
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pyscriptjs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
npm install
- name: Run linter
run: |
npm run lint