Skip to content

Commit

Permalink
Upgrade Github Actions dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecool committed Nov 11, 2024
1 parent e720fff commit 1df5a47
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/linters/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ includes:

parameters:
level: max
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- identifier: missingType.generics
- '#constructor invoked with#'
- '#FunctionVariant constructor expects#'
- '#FunctionVariant constructor expects#'
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ on: push

jobs:
php-tests:

strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2' ]
prefer: [ 'lowest', 'stable' ]
php: ["7.4", "8.0", "8.1", "8.2", "8.3"]
prefer: ["lowest", "stable"]

name: Test on PHP ${{ matrix.php }} with ${{ matrix.prefer }} composer prefer option
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -27,7 +26,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
Expand All @@ -46,8 +45,14 @@ jobs:
runs-on: ubuntu-latest

steps:
# Master branch should be available for the linter
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: master

- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -58,8 +63,12 @@ jobs:
run: composer update --prefer-stable --prefer-dist --no-progress

- name: Lint Code
uses: github/super-linter@v4
uses: super-linter/super-linter@v7
env:
FILTER_REGEX_EXCLUDE: .*vendor.*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_CHECKOV: false
VALIDATE_JSCPD: false
VALIDATE_PHP_PSALM: false
VALIDATE_PHP_PHPSTAN: false # temporary disabled until superlinter supports phpstan 2
VALIDATE_YAML_PRETTIER: false
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![Packagist Version](https://img.shields.io/packagist/v/timeweb/phpstan-enum)](https://packagist.org/packages/timeweb/phpstan-enum)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/timeweb/phpstan-enum/CI)

* [PHPStan](https://phpstan.org/)
* [PHP Enum](https://github.com/myclabs/php-enum)
- [PHPStan](https://phpstan.org/)
- [PHP Enum](https://github.com/myclabs/php-enum)

This extension defines dynamic methods for `MyCLabs\Enum\Enum` subclasses.

Expand Down
69 changes: 36 additions & 33 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
{
"name": "timeweb/phpstan-enum",
"description": "Enum class reflection extension for PHPStan",
"type": "phpstan-extension",
"keywords": ["enum", "phpstan"],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"myclabs/php-enum": "^1.2",
"phpstan/phpstan": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^9.0"
},
"autoload": {
"psr-4": {
"Timeweb\\PHPStan\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Timeweb\\Tests\\PHPStan\\": "tests/"
}
},
"scripts": {
"test": "phpunit"
},
"extra": {
"phpstan": {
"includes": [
"extension.neon",
"rules.neon"
]
}
"name": "timeweb/phpstan-enum",
"description": "Enum class reflection extension for PHPStan",
"type": "phpstan-extension",
"keywords": [
"enum",
"phpstan"
],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"myclabs/php-enum": "^1.2",
"phpstan/phpstan": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^9.0"
},
"autoload": {
"psr-4": {
"Timeweb\\PHPStan\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Timeweb\\Tests\\PHPStan\\": "tests/"
}
},
"scripts": {
"test": "phpunit"
},
"extra": {
"phpstan": {
"includes": [
"extension.neon",
"rules.neon"
]
}
}
}
10 changes: 5 additions & 5 deletions tools/composer
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ mkdir -p "$HOME/.composer/cache/"
test -t 1 && USE_TTY="--tty"

docker run --rm --interactive "${USE_TTY}" \
--user $UID:$UID \
--volume "$PWD":/app \
--volume "$HOME/.composer":/tmp/.composer \
--env COMPOSER_HOME=/tmp/.composer \
timeweb/phpstan-enum composer "$@"
--user $UID:$UID \
--volume "$PWD":/app \
--volume "$HOME/.composer":/tmp/.composer \
--env COMPOSER_HOME=/tmp/.composer \
timeweb/phpstan-enum composer "$@"
6 changes: 3 additions & 3 deletions tools/php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
test -t 1 && USE_TTY="--tty"

docker run --rm --init --interactive "${USE_TTY}" \
--user $UID:$UID \
--volume "$PWD:/app" \
timeweb/phpstan-enum php "$@"
--user $UID:$UID \
--volume "$PWD:/app" \
timeweb/phpstan-enum php "$@"
6 changes: 3 additions & 3 deletions tools/phpdbg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
test -t 1 && USE_TTY="--tty"

docker run --rm --init --interactive "${USE_TTY}" \
--user $UID:$UID \
--volume "$PWD:/app" \
timeweb/phpstan-enum phpdbg "$@"
--user $UID:$UID \
--volume "$PWD:/app" \
timeweb/phpstan-enum phpdbg "$@"

0 comments on commit 1df5a47

Please sign in to comment.