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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{js,css,scss,yml,json,.babelrc}]
[*.{js,css,scss,yml,json,.babelrc,.xml}]
indent_style = space
indent_size = 2
13 changes: 0 additions & 13 deletions .github/workflows/coding-standards.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Testing Suite

on:
push:
branches:
- develop
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
pr-tests:
# Don't run on draft PRs
if: github.event.pull_request.draft == false
# Timeout after 10 minutes
timeout-minutes: 10
# Define a matrix of PHP/WordPress versions to test against
strategy:
fail-fast: false
matrix:
php: [8.2, 8.3]
wordpress: ["latest"]
runs-on: ubuntu-latest
# Cancel any existing runs of this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}
cancel-in-progress: true
# Name the job in the matrix
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}"
steps:
- uses: actions/checkout@v4

- name: Run General Tests
# See https://github.com/alleyinteractive/action-test-general for more options
uses: alleyinteractive/action-test-general@develop

- name: Run PHP Tests
# See https://github.com/alleyinteractive/action-test-php for more options
uses: alleyinteractive/action-test-php@develop
with:
php-version: '${{ matrix.php }}'
wordpress-version: '${{ matrix.wordpress }}'
skip-wordpress-install: 'true'

# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
name: All PR checks passed
needs:
- pr-tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Check job statuses
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more jobs failed"
exit 1
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs were cancelled"
exit 1
else
echo "All jobs passed or were skipped"
exit 0
fi
20 changes: 0 additions & 20 deletions .github/workflows/unit-test.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/upload-phar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Upload Phar to Release

on:
release:
types: [created]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer, box

- name: Install Composer dependencies
run: composer install

- name: Build Phar
run: composer build

# TODO: Add tests here

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/mantle-installer.phar
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/vendor/
.DS_Store
.phpunit.result.cache
.vscode/
/vendor/
build
composer.lock
.phpunit.result.cache
.DS_Store
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

Documentation can be found inside the [Mantle documentation](https://mantle.alley.co/).

![Testing Suite](https://github.com/alleyinteractive/mantle-installer/workflows/Testing%20Suite/badge.svg)
![Coding Standards](https://github.com/alleyinteractive/mantle-installer/workflows/Coding%20Standards/badge.svg)
[![Testing Suite](https://github.com/alleyinteractive/mantle-installer/actions/workflows/tests.yml/badge.svg)](https://github.com/alleyinteractive/mantle-installer/actions/workflows/tests.yml)
4 changes: 2 additions & 2 deletions bin/mantle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if ( file_exists( __DIR__ . '/../../../autoload.php' ) ) {
require __DIR__ . '/../vendor/autoload.php';
}

$app = new Symfony\Component\Console\Application( 'Mantle Installer', '1.0.5' );
$app->add( new Mantle\Installer\Console\Install_Command() );
$app = new Symfony\Component\Console\Application( 'Mantle Installer', '1.1.0' );
$app->add( new \Mantle\Installer\InstallCommand() );

$app->run();
Binary file removed bin/wp-cli.phar
Binary file not shown.
12 changes: 12 additions & 0 deletions box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"alias": "mantle-installer.phar",
"check-requirements": false,
"chmod": "0700",
"exclude-composer-files": false,
"directories": [
"bin",
"src",
"vendor"
],
"output": "build/mantle-installer.phar"
}
37 changes: 22 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,38 @@
}
],
"require": {
"php": "^8.0",
"symfony/console": "^5.0",
"symfony/process": "^5.0"
"php": "^8.2",
"symfony/console": "^7.0",
"symfony/process": "^7.0"
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^1.0",
"phpunit/phpunit": "^9.3"
"alleyinteractive/alley-coding-standards": "^2.0",
"phpunit/phpunit": "^10.0",
"symfony/var-dumper": "^7.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Mantle\\Installer\\": "src/"
}
},
"autoload": {
"files": [
"src/class-install-command.php"
]
"autoload-dev": {
"psr-4": {
"Mantle\\Installer\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"bin": [
"bin/mantle"
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"sort-packages": true
},
"scripts": {
"build": "box compile",
"phpcs": "phpcs --standard=./phpcs.xml .",
"phpunit": "phpunit",
"test": [
Expand Down
2 changes: 2 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<exclude name="WordPress.WP.AlternativeFunctions" />
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" />
<exclude name="WordPress.NamingConventions.PrefixAllGlobals" />
<exclude name="WordPress.Security.EscapeOutput" />
<exclude name="WordPress.Files" />
</rule>
</ruleset>
28 changes: 16 additions & 12 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite name="mantle-installer">
<file>tests/test-install-command.php</file>
</testsuite>
</testsuites>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
failOnDeprecation="true"
failOnNotice="true"
failOnWarning="true"
failOnPhpunitDeprecation="true"
>
<testsuites>
<testsuite name="mantle-installer">
<file>tests/InstallCommandTest.php</file>
</testsuite>
</testsuites>
</phpunit>
Loading
Loading