Skip to content

Commit 39ee96c

Browse files
committed
Merge with Automattic/php-toolkit
2 parents 63fab6b + d9ef6ec commit 39ee96c

File tree

1,935 files changed

+591027
-57184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,935 files changed

+591027
-57184
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Check out every test-related file using LF (\n) as the line ending.
2+
#
3+
# On Windows, test fixtures are normalized to CRLF (\r\n), but our code
4+
# often expects the result to use LF (\n). For example, WXRWriter
5+
# will always output documents using LF (\n) as the line ending.
6+
#
7+
# Let's make sure we use LF (\n) as the line ending in all test files
8+
# for consistent outcomes across different operating systems.
9+
**/Tests/**/* text eol=lf
10+
/examples export-ignore
11+
/plugins export-ignore
12+
/.github export-ignore

.github/workflows/phpunit-tests-run.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,33 @@ on:
2020
env:
2121
LOCAL_PHP: ${{ inputs.php }}-fpm
2222
PHPUNIT_CONFIG: ${{ inputs.phpunit-config }}
23+
LC_ALL: en_US.UTF-8
24+
LANG: en_US.UTF-8
2325

2426
jobs:
2527
phpunit-tests:
2628
name: ${{ inputs.os }}
2729
runs-on: ${{ inputs.os }}
28-
timeout-minutes: 20
30+
# These tests can really drag on Windows CI runner!
31+
timeout-minutes: 60
2932

3033
steps:
34+
# Dev drive speeds up Windows CI tests from ~25 minutes to ~15 minutes
35+
- name: Setup RAM Disk (Windows only)
36+
uses: samypr100/setup-dev-drive@v3
37+
with:
38+
drive-size: 15GB
39+
if: ${{ inputs.os == 'windows-latest' }}
40+
41+
- name: Create DEV_DRIVE/tmp and set TEMP and TMP (Windows only)
42+
if: ${{ inputs.os == 'windows-latest' }}
43+
run: |
44+
echo "Setting TEMP and TMP to ${{ env.DEV_DRIVE }}\tmp"
45+
env:
46+
DEV_DRIVE: ${{ env.DEV_DRIVE }}
47+
TEMP: ${{ env.DEV_DRIVE }}\tmp
48+
TMP: ${{ env.DEV_DRIVE }}\tmp
49+
3150
- name: Checkout repository
3251
uses: actions/checkout@v4
3352

@@ -36,15 +55,17 @@ jobs:
3655
with:
3756
php-version: '${{ inputs.php }}'
3857
tools: phpunit-polyfills
39-
extensions: zip
58+
extensions: zip, sqlite3, pdo, pdo_sqlite
59+
ini-values: |
60+
${{ inputs.os == 'windows-latest' && format('sys_temp_dir={0}/tmp', env.DEV_DRIVE) || '' }}
4061
41-
- name: Install Composer dependencies
42-
uses: ramsey/composer-install@v3
43-
with:
44-
ignore-cache: "yes"
45-
composer-options: "--optimize-autoloader"
62+
- name: Install Composer dependencies (using composer-ci-matrix-tests.json)
63+
run: |
64+
rm composer.lock
65+
cp composer-ci-matrix-tests.json composer.json
66+
composer install --no-interaction --no-progress --optimize-autoloader
4667
4768
- name: Run PHPUnit tests
4869
# Explicitly use the composer-installed version of phpunit
4970
# because there have been conflicts with other versions during CI.
50-
run: vendor/bin/phpunit tests --testdox
71+
run: vendor/bin/phpunit --testdox

.github/workflows/phpunit-tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,26 @@ jobs:
2323
os: ${{ matrix.os }}
2424
php: ${{ matrix.php }}
2525
phpunit-config: ${{ 'phpunit.xml.dist' }}
26+
27+
# test_wasm:
28+
# name: PHP.wasm 8.2
29+
# runs-on: ubuntu-latest
30+
# steps:
31+
# - name: Checkout code
32+
# uses: actions/checkout@v2
33+
# - name: Set up PHP
34+
# uses: shivammathur/setup-php@v2
35+
# with:
36+
# php-version: '8.0'
37+
# tools: composer
38+
# - name: Install Composer dependencies
39+
# run: composer install --no-progress --no-suggest
40+
# - name: Install Node.js
41+
# uses: actions/setup-node@v2
42+
# with:
43+
# node-version: '23'
44+
# - name: Run tests
45+
# run: |
46+
# npm init -y
47+
# npm install @php-wasm/cli
48+
# PHP=8.2 node --experimental-wasm-jspi --experimental-wasm-stack-switching node_modules/@php-wasm/cli/php-wasm.js vendor/bin/phpunit

.github/workflows/release.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Set up PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.0' # Specify the PHP version you need
21+
22+
- name: Install Composer dependencies
23+
run: composer install --no-dev --prefer-dist
24+
25+
- name: Install Box
26+
run: composer global require humbug/box
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: '22'
32+
33+
- name: Install npm dependencies for static-files-editor
34+
run: |
35+
cd plugins/static-files-editor
36+
npm install
37+
38+
- name: Build all components
39+
run: bash bin/build-all.sh
40+
41+
- name: Create GitHub Release
42+
id: create_release
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: v0.0.${{ github.run_number }}-alpha
48+
release_name: Release v0.0.${{ github.run_number }}-alpha
49+
draft: false
50+
prerelease: false
51+
52+
- name: Upload Data Liberation Asset
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: ./dist/plugins/data-liberation.zip
59+
asset_name: data-liberation.zip
60+
asset_content_type: application/zip
61+
62+
- name: Upload URL Updater Asset
63+
uses: actions/upload-release-asset@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
upload_url: ${{ steps.create_release.outputs.upload_url }}
68+
asset_path: ./dist/plugins/url-updater.zip
69+
asset_name: url-updater.zip
70+
asset_content_type: application/zip
71+
72+
- name: Upload Static Files Editor Asset
73+
uses: actions/upload-release-asset@v1
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
with:
77+
upload_url: ${{ steps.create_release.outputs.upload_url }}
78+
asset_path: ./dist/plugins/static-files-editor.zip
79+
asset_name: static-files-editor.zip
80+
asset_content_type: application/zip
81+
82+
- name: Upload Import Static Files Example Asset
83+
uses: actions/upload-release-asset@v1
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
upload_url: ${{ steps.create_release.outputs.upload_url }}
88+
asset_path: ./dist/examples/create-wp-site.tar.gz
89+
asset_name: create-wp-site.tar.gz
90+
asset_content_type: application/gzip
91+
92+
93+
- name: Upload Blueprints Asset
94+
uses: actions/upload-release-asset@v1
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
with:
98+
upload_url: ${{ steps.create_release.outputs.upload_url }}
99+
asset_path: ./dist/blueprints.phar
100+
asset_name: blueprints.phar
101+
asset_content_type: application/phar

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
vendor/
2+
**/*/vendor/
23
opfs/
4+
node_modules
5+
.cursor
36
rest/
47
dist/
58
outdir/
69
.idea/
10+
.my-notes-git/
711
.vscode
812
test.php
913
run_phar.php
1014
run_src.php
1115
.phive
1216
vendor-bin
1317
new-wp
18+
.phpunit.result.cache
19+
test.txt
20+
secrets.php
21+
testing-grounds.php
22+
plugins/git-repo/git-test-server-data
23+
*.secret.json
24+
plugins/static-files-editor/build
25+
plugins/static-files-editor/node_modules
26+
url-updater.sh
27+
buntest.php
28+
blueprint-url-updater.json
29+
components/DataLiberation/Tests/test-output-html/
30+
components/DataLiberation/Tests/test-output-md
31+
blueprint-dev.json
32+
examples/create-wp-site/data-liberation.zip
33+
untracked

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"useTabs": true,
5+
"semi": true,
6+
"singleQuote": true
7+
}

0 commit comments

Comments
 (0)