Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Dec 10, 2024
2 parents 91161f2 + 2980c5c commit 377ecc2
Show file tree
Hide file tree
Showing 38 changed files with 19,104 additions and 15,443 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build new theme and push to `build` branch.

on:
push:
branches:
- master
# Enable manually running action if necessary.
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Npm install and build
run: |
npm ci
npm run build
- name: Remove build artifacts
run: |
rm -rf node_modules
- name: Ignore .gitignore
run: |
git add * --force
- name: Commit and push
# Using a specific hash here instead of a tagged version, for risk mitigation, since this action modifies our repo.
uses: actions-js/push@a52398fac807b0c1e5f1492c969b477c8560a0ba # 1.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: build
force: true
message: 'Build: ${{ github.sha }}'
30 changes: 30 additions & 0 deletions .github/workflows/lint-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Static Analysis (Linting)

# This workflow is triggered on pushes to trunk, and any PRs.
on:
push:
branches: [master]
pull_request:
workflow_dispatch:

jobs:
check:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: npm install and build
run: |
npm ci
npm run build
- name: Lint Styles
run: |
npm run lint:css
44 changes: 20 additions & 24 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,37 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: composer install --dev --prefer-dist --no-progress --no-suggest

- name: Run phpcs
uses: chekalsky/phpcs-action@v1
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
phpcs_bin_path: './vendor/bin/phpcs'
php-version: '7.4'
coverage: none
tools: composer, cs2pr

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
- name: Run PHPCS
run: |
vendor/bin/phpcs -q --report=checkstyle src | cs2pr
unit-php:
name: PHP Unit Tests

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
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 }}-
- uses: actions/checkout@v4

- name: Use Node.js 14.x
uses: actions/setup-node@v1
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 14.x
node-version-file: '.nvmrc'
cache: 'npm'

- name: Npm install and build
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
build/
node_modules/
vendor

.phpunit.result.cache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
3 changes: 2 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
],
"mappings": {
"wp-cli.yml": "./.wp-env/wp-cli.yml"
}
},
"phpVersion": "7.4"
}
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "wporg/meeting-calendar",
"type": "wordpress-plugin",
"description": "",
"homepage": "https://make.wordpress.org/meetings",
"license": "GPL-2.0-or-later",
Expand All @@ -8,7 +9,10 @@
},
"config": {
"platform": {
"php": "7.2"
"php": "7.4"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"repositories": [
Expand All @@ -22,10 +26,15 @@
"wp-coding-standards/wpcs": "2.*",
"phpcompatibility/phpcompatibility-wp": "*",
"wp-phpunit/wp-phpunit": "^5.4",
"phpunit/phpunit": "^7.5.20"
"phpunit/phpunit": "^9.5",
"yoast/phpunit-polyfills": "^3.0"
},
"scripts": {
"format": "phpcbf -p",
"lint": "phpcs"
},
"dependencies": {
"prettier": "^1.13.0",
"typescript": "^2.8.4"
}
}
Loading

0 comments on commit 377ecc2

Please sign in to comment.