8000 CI Improvements; more focused runs and best practices (#236) · wolfmib/pyscript_tutorial@b84017d · GitHub
[go: up one dir, main page]

Skip to content

Commit b84017d

Browse files
authored
CI Improvements; more focused runs and best practices (pyscript#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
1 parent b7d748c commit b84017d

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
name: Build
22

33
on:
4-
push:
4+
push: # Only run on merges into master that modify files under pyscriptjs/
55
branches: main
6-
pull_request:
7-
branches: '*'
6+
paths:
7+
- pyscriptjs/**
8+
- .github/workflows/** # Test that workflows work when changed
9+
10+
pull_request: # Run on any PR that modifies files in pyscriptjs/
11+
paths:
12+
- pyscriptjs/**
13+
- .github/workflows/**
814

915
jobs:
1016
build:
11-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-latest # Will be self hosted soon
18+
defaults:
19+
run:
20+
working-directory: ./pyscriptjs
21+
1222
steps:
1323
- name: Checkout
1424
uses: actions/checkout@v3
@@ -30,9 +40,7 @@ jobs:
3040
${{ runner.os }}-
3141
- name: Install dependencies
3242
run: |
33-
cd pyscriptjs
3443
npm install
3544
- name: Build pyscript
3645
run: |
37-
cd pyscriptjs
3846
npm run build

.github/workflows/lint.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: Lint
22

33
on:
4-
push:
5-
branches: main
6-
pull_request:
7-
branches: '*'
4+
5+
push: # Only run on merges into master that modify files under pyscriptjs/
6+
branches:
7+
- main
8+
9+
pull_request: # Run on any PR that modifies files in pyscriptjs/
810

911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./pyscriptjs
1217
steps:
1318
- name: Checkout
1419
uses: actions/checkout@v3
@@ -30,9 +35,7 @@ jobs:
3035
${{ runner.os }}-
3136
- name: Install dependencies
3237
run: |
33-
cd pyscriptjs
3438
npm install
3539
- name: Run linter
3640
run: |
37-
cd pyscriptjs
3841
npm run lint

0 commit comments

Comments
 (0)
0