Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into fix
Browse files Browse the repository at this point in the history
# Conflicts:
#	cleantalk.php
  • Loading branch information
Glomberg committed Nov 23, 2023
2 parents 0111369 + 0f937e8 commit 69a5d35
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 64 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,17 @@ jobs: # list of things to do
run: npm i

- name: Code Linting
run: npm run eslint
run: npm run eslint

- name: Telegram notify
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_PLUGINS_TO }}
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }}
message: |
Hi, <strong>${{ github.actor }}</strong>! Your commit for <strong>${{ github.repository }}</strong>
contains 💯 the best solution but it have to be fixed!
<a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Auto-Tests (PHPUnit, PHPCS, Psalm)</a> build failed ⛔!
format: html
disable_web_page_preview: true
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Auto-Tests (PHPUnit, PHPCS, Psalm) running.

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

- name: Telegram notify
if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_PLUGINS_TO }}
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }}
message: |
Hi, <strong>${{ github.actor }}</strong>! Your commit for <strong>${{ github.repository }}</strong>
contains 💯 the best solution but it have to be fixed!
<a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Auto-Tests (PHPUnit, PHPCS, Psalm)</a> build failed ⛔!
format: html
disable_web_page_preview: true
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"email": "[email protected]"
}
],
"require": {
"require-dev": {
"vimeo/psalm": "^4.8",
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "3.*",
Expand All @@ -30,5 +30,10 @@
"just_phpunit": [
"vendor/bin/phpunit --configuration tests/phpunit.xml --debug"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 1 addition & 1 deletion tests/Common/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_http__multi_request_error() {
}

public function test_http__multi_request_success() {
$res = Helper::httpMultiRequest( array('https://google.com', 'https://microsoft.com') );
$res = Helper::httpMultiRequest( array('https://google.com', 'https://apple.com') );
$this->assertIsArray( $res );
$this->assertContainsOnly( 'string', $res );
}
Expand Down
2 changes: 1 addition & 1 deletion tests/wp-test-setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
Expand Down

0 comments on commit 69a5d35

Please sign in to comment.