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 name: Build
on: on:
push: push: # Only run on merges into master that modify files under pyscriptjs/
branches: main branches: main
pull_request: paths:
branches: '*' - 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: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest # Will be self hosted soon
defaults:
run:
working-directory: ./pyscriptjs
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -30,9 +40,7 @@ jobs:
${{ runner.os }}- ${{ runner.os }}-
- name: Install dependencies - name: Install dependencies
run: | run: |
cd pyscriptjs
npm install npm install
- name: Build pyscript - name: Build pyscript
run: | run: |
cd pyscriptjs
npm run build npm run build

View File

@@ -1,14 +1,19 @@
name: Lint name: Lint
on: on:
push:
branches: main push: # Only run on merges into master that modify files under pyscriptjs/
pull_request: branches:
branches: '*' - main
pull_request: # Run on any PR that modifies files in pyscriptjs/
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pyscriptjs
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -30,9 +35,7 @@ jobs:
${{ runner.os }}- ${{ runner.os }}-
- name: Install dependencies - name: Install dependencies
run: | run: |
cd pyscriptjs
npm install npm install
- name: Run linter - name: Run linter
run: | run: |
cd pyscriptjs
npm run lint npm run lint