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
This commit is contained in:
Peter W
2022-05-06 09:46:59 -05:00
committed by GitHub
parent b7d748c96a
commit b84017d191
2 changed files with 23 additions and 12 deletions

View File

@@ -1,14 +1,24 @@
name: Build
on:
push:
push: # Only run on merges into master that modify files under pyscriptjs/
branches: main
pull_request:
branches: '*'
paths:
- pyscriptjs/**
- .github/workflows/** # Test that workflows work when changed
pull_request: # Run on any PR that modifies files in pyscriptjs/
paths:
- pyscriptjs/**
- .github/workflows/**
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest # Will be self hosted soon
defaults:
run:
working-directory: ./pyscriptjs
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -30,9 +40,7 @@ jobs:
${{ runner.os }}-
- name: Install dependencies
run: |
cd pyscriptjs
npm install
- name: Build pyscript
run: |
cd pyscriptjs
npm run build

View File

@@ -1,14 +1,19 @@
name: Lint
on:
push:
branches: main
pull_request:
branches: '*'
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
@@ -30,9 +35,7 @@ jobs:
${{ runner.os }}-
- name: Install dependencies
run: |
cd pyscriptjs
npm install
- name: Run linter
run: |
cd pyscriptjs
npm run lint