Skip to content

Commit

Permalink
Merge pull request #149 from humanmade/fix-builds
Browse files Browse the repository at this point in the history
Fixing builds and start command
  • Loading branch information
roborourke authored Jun 27, 2024
2 parents 977e4c2 + ceb3a01 commit 1455892
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 40 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysqli, xmlwriter
Expand All @@ -28,13 +28,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
Expand All @@ -43,16 +43,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node -v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
- name: Cache JS Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install JS Dependencies
run: npm install --legacy-peer-deps
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

Expand All @@ -29,16 +29,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node-v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
- name: Cache Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
run: npm install --legacy-peer-deps
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
Expand All @@ -31,21 +31,21 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.2-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: PHPCS cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: tests/cache
key: ${{ runner.os }}-phpcs-7.2-${{ hashFiles('plugin.php') }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -38,13 +38,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -41,13 +41,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp5.9

- name: Install PHP Dependencies
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ _Features without a checkmark are still work in progress._
### For development use

* Clone this repo into your plugins directory
* Install the dependencies:
* Ensure you have Composer v2 and Node v16 installed
* Install the dependencies:
`composer install && npm install`
* Start the dev server:
* Start the dev server:
`npm run start`

## Design Decisions
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"lint": "concurrently -n CSS,JS -c cyan.bold,yellow.bold \"npm run lint:css\" \"npm run lint:js\"",
"lint:css": "stylelint src/",
"lint:js": "eslint --ext .js,.jsx,.ts,.tsx src/",
"start": "webpack-dev-server --config=.config/webpack.config.dev.js",
"start": "webpack serve --config=.config/webpack.config.dev.js",
"build": "webpack --config=.config/webpack.config.prod.js",
"bump:patch": "bump patch --commit 'The v%s release' package.json package-lock.json README.md plugin.php",
"bump:minor": "bump minor --commit 'The v%s release' package.json package-lock.json README.md plugin.php",
"bump:major": "bump major --commit 'The v%s release' package.json package-lock.json README.md plugin.php"
},
"engines": {
"node": "16"
},
"dependencies": {
"@types/react-select": "^3.0.26",
"@wordpress/editor": "^9.24.3",
Expand Down

0 comments on commit 1455892

Please sign in to comment.