Skip to content

Commit f9246ef

Browse files
committed
Fix. Tests. Github action implemented instead of Travis CI.
1 parent af69d81 commit f9246ef

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Auto-Tests (PHPUnit, PHPCS, Psalm) running.
2+
3+
on: # event list
4+
push: # on push to each of these branches
5+
branches:
6+
- dev
7+
- fix
8+
- master
9+
pull_request:
10+
branches:
11+
- dev
12+
- master
13+
14+
env: # environment variables (available in any part of the action)
15+
PHP_VERSION: 7.4
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Set up PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ env.PHP_VERSION }}
26+
27+
- name: Code Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Install Dependencies
31+
run: composer i
32+
33+
- name: Running tests
34+
env:
35+
CLEANTALK_TEST_API_KEY: ${{ secrets.CLEANTALK_TEST_API_KEY }}
36+
run: composer test
37+
- name: Telegram notify
38+
if: failure()
39+
uses: appleboy/telegram-action@master
40+
with:
41+
to: ${{ secrets.TELEGRAM_PLUGINS_TO }}
42+
token: ${{ secrets.TELEGRAM_REVIEWER_TOKEN }}
43+
message: |
44+
Hi, <strong>${{ github.actor }}</strong>! Your commit for <strong>${{ github.repository }}</strong>
45+
contains 💯 the best solution but it have to be fixed!
46+
<a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Auto-Tests (PHPUnit, PHPCS, Psalm)</a> build failed ⛔!
47+
format: html
48+
disable_web_page_preview: true

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
php-antispam
22
============
3-
[![Build Status](https://travis-ci.org/CleanTalk/php-antispam.svg)](https://travis-ci.org/CleanTalk/php-antispam)
3+
![example workflow](https://github.com/CleanTalk/php-antispam/actions/workflows/tests.yml/badge.svg)
44

5-
[![Latest Stable Version](https://poser.pugx.org/cleantalk/php-antispam/v/stable.svg)](https://packagist.org/packages/cleantalk/php-antispam)
5+
[![Latest Stable Version](https://poser.pugx.org/cleantalk/php-antispam/v)](https://packagist.org/packages/cleantalk/php-antispam)
66

77
A PHP API for antispam service cleantalk.org. Invisible protection from spam, no captches, no puzzles, no animals and no math.
88

tests/CleantalkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CleantalkTest extends \PHPUnit\Framework\TestCase
2020
public function setUp()
2121
{
2222
$this->ct = new Cleantalk();
23-
$this->ct->server_url = 'http://moderate.cleantalk.org';
23+
$this->ct->server_url = 'https://moderate.cleantalk.org';
2424
$this->ct_request = new CleantalkRequest();
2525
$this->ct_request->auth_key = getenv("CLEANTALK_TEST_API_KEY");
2626
}

0 commit comments

Comments
 (0)