Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
runs:
using: "Composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: latest

- name: Cache Node Modules
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Node Modules
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
shell: bash

- name: Build
run: npm run build
shell: bash
15 changes: 14 additions & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ on:
branches: [main, master]

jobs:
changes:
name: Check Changes
runs-on: ubuntu-latest
steps:
- name: Check Changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
black:
- '**.py,**.ipynb'

black:
name: Black
needs: changes
if: needs.changes.outputs.black == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand All @@ -17,5 +31,4 @@ jobs:
- name: Run Black
uses: psf/black@stable
with:
options: '--exclude="docs/01python/07for/_samples/sum_1to100.ipynb"'
jupyter: true
20 changes: 2 additions & 18 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,5 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: latest

- name: Cache Node Modules
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Node Modules
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci

- name: Build Test
run: npm run build
- name: Build
uses: ./.github/actions/build
6 changes: 2 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install and Build 🔧
run: |
npm ci
npm run build
- name: Build
uses: ./.github/actions/build

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,42 @@ on:
branches: [main, master]

jobs:
changes:
name: Check Changes
runs-on: ubuntu-latest
steps:
- name: Check Changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
eslint:
- '**.js,**.jsx,**.ts,**.tsx'

eslint:
name: ESLint
needs: changes
if: needs.changes.outputs.eslint == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install modules
run: npm ci
- name: Cache Node Modules
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: "**/node_modules"
key: ${{ runner.os }}-eslint

- name: Install Node Mudules
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm install \
@typescript-eslint/eslint-plugin \
@typescript-eslint/parser eslint \
eslint-config-prettier \
eslint-plugin-react
shell: bash

- name: Run ESLint
run: npx eslint . --ext .js,.jsx,.ts,.tsx
23 changes: 19 additions & 4 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Prettier

on:
push:
# pull_request:
# branches: [master, main]
pull_request:
branches: [master, main]

jobs:
prettier:
Expand All @@ -16,7 +16,22 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Cache Node Modules
uses: actions/cache@v3
id: node_modules_cache_id
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Node Mudules
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci
shell: bash

- name: Run Prettier
uses: creyD/prettier_action@v4.2
run: npx prettier --write .

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
prettier_options: --write .
commit_message: Formatted!
22 changes: 11 additions & 11 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
name: Deploy PR previews

# on:
# pull_request:
# types:
# - opened
# - reopened
# - synchronize
# - closed
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
branches-ignore:
- "**"

concurrency: preview-${{ github.ref }}

Expand All @@ -19,10 +21,8 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install and Build
run: |
npm ci
npm run build
- name: Build
uses: ./.github/actions/build

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: my-website/
Expand All @@ -15,7 +16,6 @@ repos:
hooks:
- id: black
- id: black-jupyter
exclude: .*sum_1to100.ipynb
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.26.0
hooks:
Expand All @@ -36,7 +36,7 @@ repos:
rev: v0.12.0
hooks:
- id: markdownlint
args: [-r, ~MD033]
args: [-r, "~MD033, ~MD013"]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.5.3
hooks:
Expand Down
13 changes: 0 additions & 13 deletions Pipfile

This file was deleted.

Loading