Skip to content

Commit f9d3231

Browse files
authored
Merge pull request #77 from php-telegram-bot/github-actions-php8
Minimum PHP8, move tests to GitHub Actions
2 parents 4b79941 + 457ac20 commit f9d3231

19 files changed

+140
-3192
lines changed

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
tests:
14+
name: PHP ${{ matrix.php }} Test
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
php: ['8.0', '8.1']
20+
21+
services:
22+
mariadb:
23+
image: mariadb:10.3
24+
ports:
25+
- 3306:3306
26+
env:
27+
MYSQL_ROOT_PASSWORD: root
28+
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Install PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php }}
38+
extensions: pdo_mysql
39+
40+
- name: Cache Composer packages
41+
id: composer-cache
42+
uses: actions/cache@v3
43+
with:
44+
path: vendor
45+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-php-
48+
49+
- name: Validate composer.json and composer.lock
50+
run: composer validate --strict
51+
52+
- name: Install dependencies
53+
run: composer install --prefer-dist --no-progress
54+
55+
- name: Check PHP code
56+
run: composer check-code
57+
58+
- name: Run test suite
59+
if: ${{ matrix.php != '8.0'}}
60+
run: composer test
61+
62+
- name: Run test suite (with coverage)
63+
if: ${{ matrix.php == '8.0'}}
64+
run: |
65+
composer test-cov
66+
composer test-cov-upload

.gitignore

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
# IDE & System Related Files #
2+
.buildpath
3+
.project
4+
.settings
5+
.DS_Store
6+
.idea
7+
.phpintel
8+
.phpunit.result.cache
9+
110
# Composer
11+
/composer.lock
212
/composer.phar
313
/vendor
414

515
# Test-Related Files
616
/clover.xml
17+
/coverage.xml
718
/phpcs.xml
819
/phpunit.xml
920

1021
# phpDocumentor Logs
1122
phpdoc-*
1223

13-
# IDE & System-Related Files
14-
.buildpath
15-
.project
16-
.settings
17-
.idea
18-
.phpintel
24+
# OSX
1925
._*
20-
.DS_Store
2126
.Spotlight-V100
2227
.Trashes

.travis.yml

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

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
99
### Added
1010
- Enforce `secret_token` webhook validation check.
1111
### Changed
12+
- Bumped core to version 0.78.*.
13+
- Upgrade code to PHP 8.0.
14+
- Moved tests to GitHub Actions.
1215
### Deprecated
1316
### Removed
1417
### Fixed
1518
### Security
19+
- Minimum PHP 8.0.
1620

1721
## [1.7.0] - 2021-06-14
1822
### Notes

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[![Scrutinizer Code Quality][code-quality-badge]][code-quality]
77
[![Codecov][code-coverage-badge]][code-coverage]
8-
[![Build Status][build-status-badge]][build-status]
8+
[![Tests Status][tests-status-badge]][tests-status]
99

1010
[![Latest Stable Version][latest-version-badge]][github-tgbot-manager]
1111
[![Dependencies][dependencies-badge]][Tidelift]
@@ -354,7 +354,7 @@ There are 1 update(s)
354354

355355
## Development
356356

357-
When running live bot tests on a fork, you must enter the following environment variables to your [repository settings][travis-repository-settings] on travis-ci.org:
357+
When running live bot tests on a fork, you must enter the following environment variables to your [repository settings][github-actions-encrypted-secrets]:
358358
```
359359
API_KEY="12345:your_api_key"
360360
BOT_USERNAME="username_of_your_bot"
@@ -406,16 +406,16 @@ Thank you for keeping this project alive :pray:
406406
[code-quality]: https://scrutinizer-ci.com/g/php-telegram-bot/telegram-bot-manager/?branch=master "Code quality on Scrutinizer"
407407
[code-coverage-badge]: https://img.shields.io/codecov/c/github/php-telegram-bot/telegram-bot-manager.svg
408408
[code-coverage]: https://codecov.io/gh/php-telegram-bot/telegram-bot-manager "Code coverage on Codecov"
409-
[build-status-badge]: https://img.shields.io/travis/php-telegram-bot/telegram-bot-manager.svg
410-
[build-status]: https://travis-ci.org/php-telegram-bot/telegram-bot-manager "Build status on Travis-CI"
409+
[tests-status-badge]: https://github.com/php-telegram-bot/telegram-bot-manager/workflows/tests.yml/badge.svg?branch=master
410+
[tests-status]: https://github.com/php-telegram-bot/telegram-bot-manager/workflows/tests.yml "Tests status on GitHub Actions"
411411

412412
[latest-version-badge]: https://img.shields.io/packagist/v/php-telegram-bot/telegram-bot-manager.svg
413413
[dependencies-badge]: https://tidelift.com/badges/github/php-telegram-bot/core?style=flat
414414
[total-downloads-badge]: https://img.shields.io/packagist/dt/php-telegram-bot/telegram-bot-manager.svg
415415
[license-badge]: https://img.shields.io/packagist/l/php-telegram-bot/telegram-bot-manager.svg
416416

417417
[random-characters]: https://www.random.org/strings/?num=7&len=12&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new "Generate random characters"
418-
[travis-repository-settings]: https://docs.travis-ci.com/user/environment-variables#Defining-Variables-in-Repository-Settings "Repository Settings on Travis-CI"
418+
[github-actions-encrypted-secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets "Encrypted Secrets for GitHub Actions"
419419
[Composer]: https://getcomposer.org/ "Composer"
420420

421421
[Patreon]: https://www.patreon.com/phptelegrambot "Support us on Patreon"

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
}
1919
],
2020
"require": {
21-
"php": "^7.3|^8.0",
22-
"longman/telegram-bot": "^0.73",
21+
"php": "^8.0",
22+
"longman/telegram-bot": "^0.78",
2323
"longman/ip-tools": "^1.2",
24-
"psr/log": "^1.1"
24+
"psr/log": "^1.0|^2.0|^3.0"
2525
},
2626
"require-dev": {
27-
"php-parallel-lint/php-parallel-lint": "^1.2",
28-
"phpunit/phpunit": "^9.3",
29-
"squizlabs/php_codesniffer": "^3.5"
27+
"php-parallel-lint/php-parallel-lint": "^1.3",
28+
"phpunit/phpunit": "^9.5",
29+
"squizlabs/php_codesniffer": "^3.7"
3030
},
3131
"autoload": {
3232
"psr-4": {

0 commit comments

Comments
 (0)