-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
200 additions
and
1 deletion.
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,23 @@ | ||
name: Notice about releases via Telegram | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: send telegram message on release | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
message: | | ||
${{ github.event.repository.description }} <strong>v${{github.event.release.name}}</strong> released | ||
${{github.event.release.html_url}} | ||
${{ github.event.release.body }} | ||
format: html | ||
disable_web_page_preview: true |
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,27 @@ | ||
name: Notice about review approved via Telegram | ||
|
||
on: | ||
pull_request_review: | ||
types: [ submitted ] | ||
|
||
jobs: | ||
|
||
build: | ||
if: github.event.review.state == 'approved' && toJSON(github.event.pull_request.requested_reviewers) == '[]' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Convert date format | ||
id: date | ||
run: echo "::set-output name=date::$(date -d "${{ github.event.pull_request.created_at }}" +"%Y-%m-%d")" | ||
- name: Send telegram message on review approved | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_PLUGINS_TO }} | ||
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }} | ||
message: | | ||
💥🎉🎉🎉💥 Pull-request <a href="${{ github.event.pull_request.html_url }}"><strong>${{ github.event.pull_request.title }}</strong></a> | ||
submitted by <strong>${{ github.event.pull_request.user.login }}</strong> at <strong>${{ steps.date.outputs.date }}</strong> | ||
was <strong>approved</strong> and is ready to merge <a href="${{ github.event.pull_request.html_url }}">➡️</a> !!! | ||
format: html | ||
disable_web_page_preview: true |
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,53 @@ | ||
name: PHPUnit, PHPCS, Psalm | ||
|
||
on: # event list | ||
push: # on push to each of these branches | ||
branches: | ||
- dev | ||
- fix | ||
- master | ||
pull_request: | ||
branches: | ||
- dev | ||
- master | ||
|
||
env: # environment variables (available in any part of the action) | ||
PHP_VERSION: 7.4 | ||
|
||
jobs: | ||
build: | ||
name: PHPUnit, PHPCS, Psalm | ||
runs-on: ubuntu-latest | ||
env: | ||
DB_CONNECTION: mysql | ||
DB_HOST: localhost | ||
DB_PORT: 3306 | ||
DB_DATABASE: wordpress_test | ||
DB_USERNAME: root | ||
DB_PASSWORD: root | ||
|
||
steps: | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ env.PHP_VERSION }} | ||
|
||
- name: Run MySQL server | ||
run: sudo systemctl start mysql | ||
|
||
- name: Code Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Make the script files executable | ||
run: chmod +x ./tests/wp-test-setup.sh | ||
|
||
- name: Install WP develop | ||
run: ./tests/wp-test-setup.sh wordpress_test root root localhost latest | ||
|
||
- name: Install Dependencies | ||
run: composer i | ||
|
||
- name: Running tests | ||
env: | ||
CLEANTALK_TEST_API_KEY: ${{ secrets.CLEANTALK_TEST_API_KEY }} | ||
run: composer test |
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,4 +1,11 @@ | ||
* | ||
!README.md | ||
!Antispam/ | ||
!Antispam/* | ||
!Antispam/* | ||
!.github/ | ||
!.github/* | ||
!.github/workflows/ | ||
!.github/workflows/* | ||
!composer.json | ||
!tests/ | ||
!tests/** |
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,22 @@ | ||
{ | ||
"require-dev": { | ||
"vimeo/psalm": "^4.8", | ||
"phpunit/phpunit": "^7.5", | ||
"squizlabs/php_codesniffer": "3.*", | ||
"phpcompatibility/php-compatibility": "@dev" | ||
}, | ||
"scripts": { | ||
"test": [ | ||
"vendor/bin/phpunit --configuration tests/phpunit.xml", | ||
"vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility", | ||
"vendor/bin/phpcs --standard=tests/.phpcs.xml", | ||
"vendor/bin/psalm --no-cache --config=tests/psalm.xml", | ||
"vendor/bin/psalm --no-cache --config=tests/psalm.xml --taint-analysis" | ||
] | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
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,27 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<description>Sniff code to check different PHP compatibility</description> | ||
|
||
<!-- What to scan --> | ||
<file>../Antispam</file> | ||
|
||
<!-- How to scan --> | ||
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage --> | ||
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<arg value="sp"/> <!-- Show sniff and progress --> | ||
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit --> | ||
<arg name="colors"/> | ||
<arg name="extensions" value="php"/> | ||
<arg name="exclude" value="PSR12.ControlStructures.ControlStructureSpacing"/> | ||
<arg value="n"/> | ||
|
||
<!-- Rules: Check PHP version compatibility --> | ||
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> | ||
<config name="testVersion" value="5.6-"/> | ||
|
||
<rule ref="PHPCompatibility"> | ||
<exclude name="PHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefault.NotSet"/> | ||
<exclude name="PHPCompatibility.Attributes.NewAttributes.Found"/> | ||
</rule> | ||
<rule ref="PSR12"/> | ||
</ruleset> |
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 @@ | ||
<?php |
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<phpunit | ||
bootstrap="bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnFailure="true" | ||
beStrictAboutOutputDuringTests="true" | ||
> | ||
<testsuites> | ||
<testsuite name="CleanTalk Unit Tests"> | ||
<directory suffix=".php">./</directory> | ||
<exclude>./bootstrap.php</exclude> | ||
</testsuite> | ||
</testsuites> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
name="Psalm for CleanTalk for MediaWiki" | ||
autoloader="bootstrap.php" | ||
errorLevel="3" | ||
throwExceptionOnError="0" | ||
findUnusedCode="true" | ||
ensureArrayStringOffsetsExist="true" | ||
ensureArrayIntOffsetsExist="true" | ||
allowNamedArgumentCalls="false" | ||
hoistConstants="true" | ||
phpVersion="5.6" | ||
hideExternalErrors="true" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config config.xsd" | ||
limitMethodComplexity="true" | ||
> | ||
<projectFiles> | ||
<directory name="../Antispam"/> | ||
</projectFiles> | ||
</psalm> |