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
30 changes: 30 additions & 0 deletions .github/actions/cache-restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Cache restoration'
description: 'Setup a NodeJS environment and restore cache if any, given a node version'

inputs:
node-version:
description: 'Node version to use, default to LTS'
required: true
default: 22
outputs:
cache-hit:
description: 'Forward actions/cache cache-hit output'
value: ${{ steps.node-cache.outputs.cache-hit }}

runs:
using: 'composite' # Mandatory parameter
steps:
# Setup a Node environment given a node version
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Cache Node Modules
id: node-cache
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.cache
key: ${{ runner.os }}-${{ inputs.node-version }}-${{ hashFiles('package-lock.json') }}
44 changes: 44 additions & 0 deletions .github/workflows/check-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Package Code Quality

on:
pull_request:
branches: [canary]
paths-ignore:
- '**/*.md'
- '**/*.php'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
setup-node:
name: Setup Dependencies
uses: ./.github/workflows/node-setup.yml
strategy:
matrix:
node-version: [22]
with:
node-version: ${{ matrix.node-version }}
check_lint:
name: Validate package linting
runs-on: ubuntu-latest
needs: [setup-node]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: ./.github/actions/cache-restore
- name: Check Linting
run: npm run lint
check_format:
name: Validate package formatting
runs-on: ubuntu-latest
needs: [setup-node]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: ./.github/actions/cache-restore
- name: Check Formatting
run: npm run test:format
19 changes: 0 additions & 19 deletions .github/workflows/lint-packages.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/lint-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
paths-ignore:
- '**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint_plugin:
runs-on: ubuntu-22.04
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/node-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Node Workspace Setup'
description: 'Setup a environment and restore cache if any, given a node version'

on:
workflow_call:
inputs:
node-version:
description: 'Node version to use, default to LTS'
required: true
type: string
default: '22'

jobs:
setup:
name: Setup Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ inputs.node-version }}
uses: ./.github/actions/cache-restore
id: cache-node-modules
with:
node-version: ${{ inputs.node-version }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
2 changes: 1 addition & 1 deletion .github/workflows/notify-discord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
release_plugin:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Discord Notification
env:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"dev:next:getting-started": "rimraf examples/next/faustwp-getting-started/.next && npm run dev ---workspace=examples/next/faustwp-getting-started",
"test": "npm run build && npm test --workspace=@faustwp/core --workspace=@faustwp/cli --workspace=@faustwp/blocks --workspace=@faustwp/block-editor-utils",
"test:coverage": "npm run build && npm run test:coverage --workspace=@faustwp/block-editor-utils",
"test:format": "npm run test:format --workspace=@faustwp/cli --workspace=@faustwp/core --workspace=@faustwp/block-editor-utils",
"wpe-build": "exit 1",
"changeset": "changeset",
"version": "changeset version && node scripts/versionPlugin.js",
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"clean": "rimraf dist",
"package": "node ../../scripts/package.js",
"test": "",
"test:format": "prettier . --check",
"build": "npm run build-esm && npm run build-cjs",
"build-esm": "tsc -p .",
"build-cjs": "tsc -p tsconfig.cjs.json",
Expand Down
1 change: 1 addition & 0 deletions packages/faustwp-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"test": "jest",
"test:coverage:ci": "jest --ci --json --coverage --testLocationInResults --passWithNoTests --outputFile=report.json",
"test:coverage": "jest --coverage",
"test:format": "prettier . --check",
"test:watch": "jest --watch"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions packages/faustwp-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"prepublish": "npm run build",
"test:coverage:ci": "jest --ci --json --coverage --testLocationInResults --outputFile=report.json",
"test:coverage": "jest --coverage",
"test:format": "prettier . --check",
"test:watch": "jest --watch",
"test": "jest",
"build-cjs": "tsc -p tsconfig-cjs.json",
Expand Down
Loading