mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-25 12:01:07 -05:00
Add additional pre-commit hooks (#245)
* Add and run end-of-file-fixer * Add and run trailing-whitespace * Add and run check-yaml * Add and run check-json * Add and run pretty-format-yaml * Fix comment indentation
This commit is contained in:
76
.github/workflows/build.yml
vendored
76
.github/workflows/build.yml
vendored
@@ -1,46 +1,46 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push: # Only run on merges into master that modify files under pyscriptjs/
|
||||
branches: main
|
||||
paths:
|
||||
- pyscriptjs/**
|
||||
- .github/workflows/** # Test that workflows work when changed
|
||||
push: # Only run on merges into master that modify files under pyscriptjs/
|
||||
branches: main
|
||||
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/**
|
||||
pull_request: # Run on any PR that modifies files in pyscriptjs/
|
||||
paths:
|
||||
- pyscriptjs/**
|
||||
- .github/workflows/**
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest # Will be self hosted soon
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./pyscriptjs
|
||||
build:
|
||||
runs-on: ubuntu-latest # Will be self hosted soon
|
||||
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:
|
||||
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: Build pyscript
|
||||
run: |
|
||||
npm run build
|
||||
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: Build pyscript
|
||||
run: |
|
||||
npm run build
|
||||
|
||||
67
.github/workflows/lint.yml
vendored
67
.github/workflows/lint.yml
vendored
@@ -1,41 +1,40 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push: # Only run on merges into master that modify files under pyscriptjs/
|
||||
branches:
|
||||
- main
|
||||
|
||||
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/
|
||||
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:
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user