Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 19 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: CI

on: [push, pull_request]
on:
push:
pull_request:

permissions:
contents: read
actions: read
id-token: none

jobs:
composer:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Cache Composer dependencies
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -27,6 +28,7 @@ jobs:
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
php_extensions: pcntl

- name: Archive build
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
Expand All @@ -36,13 +38,14 @@ jobs:
with:
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions
retention-days: 1

phpunit:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

outputs:
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
Expand Down Expand Up @@ -77,7 +80,7 @@ jobs:
needs: [ phpunit ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -92,13 +95,16 @@ jobs:

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}

phpstan:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -114,13 +120,15 @@ jobs:
with:
php_version: ${{ matrix.php }}
path: src/
level: 6
memory_limit: 256M

phpmd:
runs-on: ubuntu-latest
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -132,7 +140,7 @@ jobs:
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Mess Detector
uses: php-actions/phpmd@v2
uses: php-actions/phpmd@v1
with:
php_version: ${{ matrix.php }}
path: src/
Expand All @@ -144,7 +152,7 @@ jobs:
needs: [ composer ]
strategy:
matrix:
php: [ 8.2, 8.3, 8.4 ]
php: [ 8.2, 8.3, 8.4, 8.5 ]

steps:
- uses: actions/download-artifact@v4
Expand All @@ -161,21 +169,3 @@ jobs:
php_version: ${{ matrix.php }}
path: src/
standard: phpcs.xml

remove_old_artifacts:
runs-on: ubuntu-latest

permissions:
actions: write

steps:
- name: Remove old artifacts for prior workflow runs on this repository
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
while read id
do
echo -n "Deleting artifact ID $id ... "
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
done <artifact-id-list.txt
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Sessions are addressed using dot notation, allowing for handling categories of s
<img src="https://badge.status.php.gt/session-version.svg" alt="Current version" />
</a>
<a href="http://www.php.gt/session" target="_blank">
<img src="https://badge.status.php.gt/session-docs.svg" alt="PHP.Gt/Session documentation" />
<img src="https://badge.status.php.gt/session-docs.svg" alt="PHP.GT/Session documentation" />
</a>

## Example usage: Welcome a user by their first name or log out the user
Expand All @@ -44,7 +44,7 @@ else {

## Redis session storage

This package now includes `Gt\Session\RedisHandler` for shared session storage.
This package now includes `GT\Session\RedisHandler` for shared session storage.
It works with Redis-compatible backends such as Redis and Valkey, and is intended
for deployments where application nodes are disposable and session state needs to
survive traffic moving between servers.
Expand All @@ -56,7 +56,7 @@ Example production config:

```ini
[session]
handler=Gt\Session\RedisHandler
handler=GT\Session\RedisHandler
save_path=rediss://default:secret@example-redis.internal:25061/0?prefix=GT:&ttl=1440
name=GT
use_cookies=true
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"phpgt/typesafegetter": "^1.3"
},
"suggest": {
"ext-redis": "Required to use Gt\\Session\\RedisHandler."
"ext-redis": "Required to use GT\\Session\\RedisHandler."
},
"require-dev": {
"phpstan/phpstan": "^2.1",
Expand All @@ -19,7 +19,7 @@

"scripts": {
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
"phpstan": "vendor/bin/phpstan analyse --level 6 src",
"phpstan": "vendor/bin/phpstan analyse --level 6 src --memory-limit 256M",
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
"test": [
Expand All @@ -32,12 +32,13 @@

"autoload": {
"psr-4": {
"GT\\Session\\": "./src",
"Gt\\Session\\": "./src"
}
},
"autoload-dev": {
"psr-4": {
"Gt\\Session\\Test\\": "./test/phpunit"
"GT\\Session\\Test\\": "./test/phpunit"
}
},

Expand Down
Loading
Loading