Skip to content

Commit ca866a3

Browse files
authored
Add box for standalone phar, upgrade deps (#42)
* Bumping * Fixing up * PHPCS * Updating to pass * Add a box config for a standlone phar * Lock to 11 * Skip build * PHPUnit 10 * Fix indenting * Fix indenting * Link fix, account for running inside a wp-content dir * README * Remove dep on wp-cli * Prompt the user before installing at plugins/mantle
1 parent 9b4aeed commit ca866a3

File tree

15 files changed

+231
-129
lines changed

15 files changed

+231
-129
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ insert_final_newline = true
88
trim_trailing_whitespace = true
99
indent_style = tab
1010

11-
[*.{js,css,scss,yml,json,.babelrc}]
11+
[*.{js,css,scss,yml,json,.babelrc,.xml}]
1212
indent_style = space
1313
indent_size = 2

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Testing Suite
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
pr-tests:
13+
# Don't run on draft PRs
14+
if: github.event.pull_request.draft == false
15+
# Timeout after 10 minutes
16+
timeout-minutes: 10
17+
# Define a matrix of PHP/WordPress versions to test against
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php: [8.2, 8.3]
22+
wordpress: ["latest"]
23+
runs-on: ubuntu-latest
24+
# Cancel any existing runs of this workflow
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}
27+
cancel-in-progress: true
28+
# Name the job in the matrix
29+
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}"
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Run General Tests
34+
# See https://github.com/alleyinteractive/action-test-general for more options
35+
uses: alleyinteractive/action-test-general@develop
36+
37+
- name: Run PHP Tests
38+
# See https://github.com/alleyinteractive/action-test-php for more options
39+
uses: alleyinteractive/action-test-php@develop
40+
with:
41+
php-version: '${{ matrix.php }}'
42+
wordpress-version: '${{ matrix.wordpress }}'
43+
skip-wordpress-install: 'true'
44+
45+
# This required job ensures that all PR checks have passed before merging.
46+
all-pr-checks-passed:
47+
name: All PR checks passed
48+
needs:
49+
- pr-tests
50+
runs-on: ubuntu-latest
51+
if: always()
52+
steps:
53+
- name: Check job statuses
54+
run: |
55+
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
56+
echo "One or more jobs failed"
57+
exit 1
58+
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
59+
echo "One or more jobs were cancelled"
60+
exit 1
61+
else
62+
echo "All jobs passed or were skipped"
63+
exit 0
64+
fi

.github/workflows/unit-test.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/upload-phar.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Upload Phar to Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: '8.2'
18+
tools: composer, box
19+
20+
- name: Install Composer dependencies
21+
run: composer install
22+
23+
- name: Build Phar
24+
run: composer build
25+
26+
# TODO: Add tests here
27+
28+
- name: Release
29+
uses: softprops/action-gh-release@v2
30+
if: startsWith(github.ref, 'refs/tags/')
31+
with:
32+
files: |
33+
build/mantle-installer.phar

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/vendor/
1+
.DS_Store
2+
.phpunit.result.cache
23
.vscode/
4+
/vendor/
5+
build
36
composer.lock
4-
.phpunit.result.cache
5-
.DS_Store

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22

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

5-
![Testing Suite](https://github.com/alleyinteractive/mantle-installer/workflows/Testing%20Suite/badge.svg)
6-
![Coding Standards](https://github.com/alleyinteractive/mantle-installer/workflows/Coding%20Standards/badge.svg)
5+
[![Testing Suite](https://github.com/alleyinteractive/mantle-installer/actions/workflows/tests.yml/badge.svg)](https://github.com/alleyinteractive/mantle-installer/actions/workflows/tests.yml)

bin/mantle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if ( file_exists( __DIR__ . '/../../../autoload.php' ) ) {
77
require __DIR__ . '/../vendor/autoload.php';
88
}
99

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

1313
$app->run();

bin/wp-cli.phar

-6.19 MB
Binary file not shown.

box.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"alias": "mantle-installer.phar",
3+
"check-requirements": false,
4+
"chmod": "0700",
5+
"exclude-composer-files": false,
6+
"directories": [
7+
"bin",
8+
"src",
9+
"vendor"
10+
],
11+
"output": "build/mantle-installer.phar"
12+
}

0 commit comments

Comments
 (0)