Skip to content
This repository was archived by the owner on Oct 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e74c248
added main workflow
jasonw4331 Nov 11, 2021
32c010d
workflow formatting
jasonw4331 Nov 11, 2021
d964a77
rename task
jasonw4331 Nov 11, 2021
c23d183
fixed cs fixer
jasonw4331 Nov 11, 2021
fe332f5
Removed preprocessor + fixed integrations
jasonw4331 Nov 11, 2021
81fb465
try fixing composer
jasonw4331 Nov 11, 2021
7072ea7
php changes
jasonw4331 Nov 11, 2021
ae10bb5
modified phpstan config
jasonw4331 Nov 11, 2021
0037935
thank you for always auto indenting -_-
jasonw4331 Nov 11, 2021
d0ccb89
fixed bad path
jasonw4331 Nov 11, 2021
a29656c
I figured it out
jasonw4331 Nov 11, 2021
ce22b55
corrections: now I figured it out
jasonw4331 Nov 11, 2021
f01fb22
We don't have phpunit tests yet
jasonw4331 Nov 11, 2021
4441eaf
fixed integration test path
jasonw4331 Nov 11, 2021
8a3be6e
why is my bash script not executable?
jasonw4331 Nov 11, 2021
0f11ec2
delete path that doesn't exist
jasonw4331 Nov 11, 2021
31758c9
remove old testing methods
jasonw4331 Nov 12, 2021
2535ec3
Added security and contribution info
jasonw4331 Nov 12, 2021
bb331e3
Generated phpstan baseline
jasonw4331 Nov 14, 2021
1a04295
baseline was in wrong place...
jasonw4331 Nov 14, 2021
202fd65
phpstorm can you not make tabs spaces pls
jasonw4331 Nov 14, 2021
6bf8a0c
baseline can be its own file
jasonw4331 Nov 14, 2021
fddf320
phpstan workflow changes
jasonw4331 Nov 15, 2021
464a899
phpstan workflow changes
jasonw4331 Nov 15, 2021
ebbb0b7
path fixed?
jasonw4331 Nov 15, 2021
2b5b038
ignore errors unrelated to myplot directly
jasonw4331 Nov 15, 2021
5f4d820
regex
jasonw4331 Nov 15, 2021
17f374b
baseline?
jasonw4331 Nov 15, 2021
33fc144
caps matters here
jasonw4331 Nov 15, 2021
e813524
more phpstan config work
jasonw4331 Nov 15, 2021
e51bffe
Delete poggit Phpstan config
jasonw4331 Nov 15, 2021
fe59dae
delete phpstan neon file
jasonw4331 Nov 15, 2021
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
195 changes: 195 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-php:
name: Prepare PHP
runs-on: ${{ matrix.image }}

strategy:
matrix:
image: [ubuntu-20.04]
php: [8.0.11]

steps:
- name: Build and prepare PHP cache
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
with:
php-version: ${{ matrix.php }}
install-path: "./bin"

phpstan:
name: PHPStan analysis
needs: build-php
runs-on: ${{ matrix.image }}

strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.11]

steps:
- name: Checkout PocketMine
uses: actions/checkout@v2
with:
repository: pmmp/PocketMine-MP
submodules: true
ref: stable
path: "./"

- name: Checkout Repo
uses: actions/checkout@v2
with:
path: "./plugins/${{ github.event.repository.name }}"

- name: Replace PocketMine Phpstan config
run: cp -f ./plugins/${{ github.event.repository.name }}/tests/phpstan.neon.dist phpstan.neon.dist

- name: Delete poggit Phpstan config
run: rm -f ./plugins/${{ github.event.repository.name }}/phpstan.neon.dist

- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
with:
php-version: ${{ matrix.php }}
install-path: "./bin"

- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php

- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-

- name: Install Composer dependencies
run: php composer.phar install --prefer-dist --no-interaction

- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --no-progress --memory-limit=2G

# phpunit:
# name: PHPUnit tests
# needs: build-php
# runs-on: ${{ matrix.image }}
# strategy:
# fail-fast: false
# matrix:
# image: [ubuntu-20.04]
# php: [8.0.11]
#
# steps:
# - name: Checkout PocketMine
# uses: actions/checkout@v2
# with:
# repository: pmmp/PocketMine-MP
# submodules: true
# ref: stable
# path: "./"
#
# - name: Checkout Repo
# uses: actions/checkout@v2
# with:
# path: "./plugins/${{ github.event.repository.name }}"
#
# - name: Setup PHP
# uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
# with:
# php-version: ${{ matrix.php }}
# install-path: "./bin"
#
# - name: Install Composer
# run: curl -sS https://getcomposer.org/installer | php
#
# - name: Restore Composer package cache
# uses: actions/cache@v2
# with:
# path: |
# ~/.cache/composer/files
# ~/.cache/composer/vcs
# key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
# restore-keys: |
# composer-v2-cache-
#
# - name: Install Composer dependencies
# run: php composer.phar install --prefer-dist --no-interaction
#
# - name: Run PHPUnit tests
# run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning ./plugins/${{ github.event.repository.name }}/tests/phpunit

integration:
name: Integration tests
needs: build-php
runs-on: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.11]

steps:
- name: Checkout PocketMine
uses: actions/checkout@v2
with:
repository: pmmp/PocketMine-MP
submodules: true
ref: stable
path: "./"

- name: Checkout Repo
uses: actions/checkout@v2
with:
path: "./plugins/${{ github.event.repository.name }}"

- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
with:
php-version: ${{ matrix.php }}
install-path: "./bin"

- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php

- name: Restore Composer package cache
uses: actions/cache@v2
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
restore-keys: |
composer-v2-cache-

- name: Install Composer dependencies
run: php composer.phar install --no-dev --prefer-dist --no-interaction

- name: Run integration tests
run: chmod +x ./plugins/${{ github.event.repository.name }}/tests/integration-action.sh && ./plugins/${{ github.event.repository.name }}/tests/integration-action.sh -t4

codestyle:
name: Code Style checks
runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Setup PHP and tools
uses: shivammathur/setup-php@2.15.0
with:
php-version: 8.0
tools: php-cs-fixer:3.2

- name: Run PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --diff
71 changes: 71 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src');

return (new PhpCsFixer\Config)
->setRiskyAllowed(true)
->setRules([
'align_multiline_comment' => [
'comment_type' => 'phpdocs_only'
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short'
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => [
'declare'
]
],
'cast_spaces' => [
'space' => 'single'
],
'concat_space' => [
'spacing' => 'one'
],
'declare_strict_types' => true,
'elseif' => true,
'global_namespace_import' => [
'import_constants' => true,
'import_functions' => true,
'import_classes' => null,
],
'indentation_type' => true,
'native_function_invocation' => [
'scope' => 'namespaced',
'include' => ['@all'],
],
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_whitespace_in_blank_line' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha'
],
'phpdoc_line_span' => [
'property' => 'single',
'method' => null,
'const' => null
],
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'single_import_per_statement' => true,
'strict_param' => true,
])
->setFinder($finder)
->setIndent("\t")
->setLineEnding("\n");
5 changes: 0 additions & 5 deletions .travis.pmcommands.txt

This file was deleted.

44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

Loading