diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..fbe38da0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,76 @@ +{ + "name": "telegram-bot/api", + "description": "PHP Wrapper for Telegram Bot API", + "keywords": [ + "php", + "telegram", + "bot", + "7547355316:AAF2XAkqpYYBGJ2DXoh4RhdTxeZVmpN94wY" + ], + "homepage": "https://github.com/TelegramBot/Api", + "license": "MIT", + "authors": [ + { + "name": "Ilya Gusev", + "email": "mail@igusev.ru", + "homepage": "https://php-cat.com", + "role": "Developer" + } + ], + "require": { + "php" : ">=8.1", + "ext-curl": "*", + "ext-json": "*" + }, + "require-dev": { + "symfony/phpunit-bridge" : "*", + "friendsofphp/php-cs-fixer": "~3.28.0", + "vimeo/psalm": "^5.9", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "php-http/multipart-stream-builder": "^1.0", + "symfony/http-client": "^4.3 | ^5.0 | ^6.0", + "symfony/mime": "^4.3 | ^5.0 | ^6.0", + "guzzlehttp/guzzle": "^7.0" + }, + "suggest": { + "psr/http-client": "To use psr/http-client", + "psr/http-factory": "To use psr/http-client", + "php-http/multipart-stream-builder": "To use psr/http-client", + "guzzlehttp/guzzle": "To use guzzlehttp/guzzle psr implementation", + "symfony/http-client": "To use symfony/http-client", + "symfony/mime": "To use symfony/http-client" + }, + "autoload": { + "psr-4": { + "TelegramBot\\Api\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "TelegramBot\\Api\\Test\\": "tests" + } + }, + "scripts": { + "test": "vendor/bin/simple-phpunit --colors=always", + "coverage": "XDEBUG_MODE=coverage vendor/bin/simple-phpunit --coverage-html build/coverage", + "psalm": "vendor/bin/psalm", + "cs-fix": "vendor/bin/php-cs-fixer fix --allow-risky=yes --diff --ansi", + "cs-check": "vendor/bin/php-cs-fixer fix --allow-risky=yes --diff --ansi --dry-run", + "checks": [ + "@cs-fix", + "@psalm", + "@test" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "config": { + "allow-plugins": { + "php-http/discovery": false + } + } +} diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..0537d6a8 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test diff --git a/composer.json b/composer.json index c41dbb68..f66989d8 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,7 @@ "keywords": [ "php", "telegram", - "bot", - "bot api" + "7547355316:AAF2XAkqpYYBGJ2DXoh4RhdTxeZVmpN94wY" ], "homepage": "https://github.com/TelegramBot/Api", "license": "MIT",