From 27a140e278c55b1b04e80de92790fedcc65b2350 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Thu, 27 Feb 2025 14:59:20 +0000 Subject: [PATCH 1/5] Add GitHub workflow --- .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++++ composer.json | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..553cada --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,42 @@ +name: "Test" + +on: + push: + branches: + - "master" + pull_request: null + +permissions: + contents: "read" + +jobs: + test: + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + - "8.2" + - "8.3" + - "8.4" + + steps: + - name: "Checkout repository" + uses: "actions/checkout@v4" + + - name: "Set up PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Vadliate composer" + run: "composer validate --strict" + + - name: "Install dependencies" + run: "composer install" + + - run: "composer run test" \ No newline at end of file diff --git a/composer.json b/composer.json index 98f674d..385d37b 100644 --- a/composer.json +++ b/composer.json @@ -33,5 +33,8 @@ "vimeo/psalm": "^4.1", "phpunit/phpunit": "^9.4", "friendsofphp/php-cs-fixer": "^2.16 || ^3.12" + }, + "scripts": { + "test": "phpunit --verbose" } } From eb2d52cccf604cdbf55880d2f6d79fa9fb204e45 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Thu, 27 Feb 2025 15:04:08 +0000 Subject: [PATCH 2/5] Remove travis config file and add GH status badge --- .github/workflows/test.yml | 2 +- .travis.yml | 24 ------------------------ README.md | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 553cada..3bcc0ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: "Test" +name: "PHP Tests" on: push: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ed73251..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -# TravisCI configuration for php-stubs/generator - -language: "php" -os: - - "linux" -dist: "bionic" - -php: - - "7.3" - - "7.4" - - "8.0" - -cache: - directories: - - "${HOME}/.composer/cache" - -before_install: - - "composer validate --strict" - -install: - - "composer update" - -script: - - "vendor/bin/phpunit --verbose" diff --git a/README.md b/README.md index 13eea8a..c155dbc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP Stubs Generator -[![Build Status](https://travis-ci.com/php-stubs/generator.svg?branch=master)](https://travis-ci.com/github/php-stubs/generator) +[![Build Status](https://github.com/php-stubs/generator/actions/workflows/test.yml/badge.svg)](https://github.com/php-stubs/generator/actions/workflows/test.yml) Use this tool to generate stub declarations for functions, classes, interfaces, and global variables defined in any PHP code. The stubs can subsequently be used to facilitate IDE completion or static analysis via [PHPStan](https://phpstan.org) or potentially other tools. Stub generation is particularly useful for code which mixes definitions with side-effects. From 738a0415b7b11524e6b70172c6debff69bf8ae9a Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Thu, 27 Feb 2025 15:07:35 +0000 Subject: [PATCH 3/5] Add dependabot config for GH actions --- .github/dependabot.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..96fee09 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Configure Dependabot scanning. +version: 2 + +updates: + # Check for updates to GitHub Actions. + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + open-pull-requests-limit: 10 + groups: + github-actions: + patterns: + - "*" From 21535e6ea3f22e218681c7aaa48587cf11edabd5 Mon Sep 17 00:00:00 2001 From: Mike Manger Date: Thu, 27 Feb 2025 15:12:23 +0000 Subject: [PATCH 4/5] Add php 7.3 back to test matrix --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bcc0ec..2781a0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,7 @@ jobs: strategy: matrix: php-version: + - "7.3" - "7.4" - "8.0" - "8.1" From 7674c1c74cf0bbc18fb3fbb778c260fd0a541251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 27 Feb 2025 16:20:44 +0100 Subject: [PATCH 5/5] Run composer update --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2781a0b..9424557 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,6 +38,6 @@ jobs: run: "composer validate --strict" - name: "Install dependencies" - run: "composer install" + run: "composer update --no-interaction" - - run: "composer run test" \ No newline at end of file + - run: "composer run test"