-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from timber/2.x-fix-tests
- Loading branch information
Showing
7 changed files
with
137 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.gitattributes export-ignore | ||
/.github export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Timber starter theme tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '1.x' | ||
- '2.x' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- ready_for_review | ||
|
||
# Cancel previous workflow run groups that have not completed. | ||
concurrency: | ||
# Group workflow runs by workflow name, along with the head branch ref of the pull request | ||
# or otherwise the branch or tag ref. | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
phpunit: | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.4', '8.0', '8.1'] | ||
wp: ['latest'] | ||
multisite: ['0', '1'] | ||
extensions: ['gd'] | ||
experimental: [false] | ||
include: | ||
# WP Trunk | ||
- php: '7.4' | ||
wp: 'trunk' | ||
multisite: '0' | ||
experimental: true | ||
# PHP 8.0 | ||
- php: '8.0' | ||
wp: 'latest' | ||
multisite: '0' | ||
experimental: false | ||
# PHP 8.1 | ||
- php: '8.1' | ||
wp: 'latest' | ||
multisite: '0' | ||
experimental: false | ||
# PHP 8.1 / experimental | ||
- php: '8.1' | ||
wp: 'trunk' | ||
multisite: '0' | ||
experimental: true | ||
# PHP 8.2 / experimental | ||
- php: '8.2' | ||
wp: 'trunk' | ||
multisite: '0' | ||
experimental: true | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
extensions: curl, date, dom, iconv, json, libxml, gd | ||
|
||
- name: Setup problem matchers for PHP | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
||
- name: Setup problem matchers for PHPUnit | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
|
||
- uses: ramsey/composer-install@v2 | ||
|
||
- name: Run tests | ||
run: composer run test | ||
env: | ||
WP_MULTISITE: ${{ matrix.multisite }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
"description": "Starter theme to build a Timber theme", | ||
"type":"wordpress-theme", | ||
"license": "MIT", | ||
"minimum-stability" : "dev", | ||
"authors": [ | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -20,9 +19,8 @@ | |
"timber/timber": "2.x-dev" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "7.*", | ||
"roots/wordpress": "^5.4", | ||
"automattic/wordbless": "^0.1.0" | ||
"automattic/wordbless": "^0.4.2", | ||
"yoast/wp-test-utils": "^1.0" | ||
}, | ||
"extra": { | ||
"installer-paths": { | ||
|
@@ -31,5 +29,14 @@ | |
] | ||
}, | ||
"wordpress-install-dir": "wordpress" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"roots/wordpress-core-installer": true, | ||
"composer/installers": true | ||
} | ||
}, | ||
"scripts": { | ||
"test": "phpunit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
<?php | ||
|
||
use WorDBless\Load; | ||
|
||
if (! file_exists( dirname(__DIR__) . '/wordpress/wp-content')) { | ||
mkdir(dirname(__DIR__) . '/wordpress/wp-content'); | ||
} | ||
|
||
if (! file_exists(dirname(__DIR__) . '/wordpress/wp-content/themes')) { | ||
mkdir(dirname(__DIR__) . '/wordpress/wp-content/themes'); | ||
} | ||
|
||
copy( | ||
dirname( __DIR__ ) . '/vendor/automattic/wordbless/src/dbless-wpdb.php', | ||
dirname( __DIR__ ) . '/wordpress/wp-content/db.php' | ||
); | ||
|
||
$theme_base_name = basename( dirname( __DIR__ ) ); | ||
$src = realpath( dirname( dirname( __DIR__ ) ) . '/' . $theme_base_name ); | ||
$dest = dirname( __DIR__ ) . '/wordpress/wp-content/themes/' . $theme_base_name; | ||
|
||
if ( is_dir($src) && ! file_exists($dest) ) { | ||
symlink($src, $dest); | ||
} | ||
|
||
require_once dirname( __DIR__ ) . '/vendor/autoload.php'; | ||
|
||
\WorDBless\Load::load(); | ||
Load::load(); |