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
64 changes: 13 additions & 51 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ on:
- php-actions
pull_request:
branches:
- 11.x
- 12.x
paths:
- ".github/workflows/php.yml"
- "src/**"
- "tests/**"
- ".github/workflows/php.yml"
- "composer.json"
- "composer.lock"
- "phpunit.xml"

env:
PHP_VERSION: 8.5

jobs:
install-dependencies:
runs-on: ubuntu-latest
Expand All @@ -26,7 +29,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, gd, zip

- name: Install PHP dependencies
Expand All @@ -39,13 +42,6 @@ jobs:
key: php-vendor-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-vendor-${{ runner.os }}-${{ github.run_id }}

- name: Cache composer.lock
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

composer-validation:
runs-on: ubuntu-latest
name: Composer Validation
Expand All @@ -58,16 +54,9 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, gd, zip

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -96,17 +85,10 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
base-ref: main
base-ref: ${{ github.event.repository.default_branch }}
head-ref: ${{ github.sha }}
comment-summary-in-pr: true
# Possible values: "critical", "high", "moderate", "low"
Expand All @@ -125,16 +107,9 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, gd, zip

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -172,7 +147,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, gd, zip, xdebug
coverage: xdebug
ini-values: |
Expand All @@ -181,13 +156,6 @@ jobs:
xdebug.log_level=0
tools: composer

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
Expand All @@ -199,7 +167,7 @@ jobs:
run: php -S 0.0.0.0:8000 -t public &

- name: Run tests
run: php vendor/bin/phpunit --coverage-clover tests/build/logs/clover.xml --coverage-html tests/build/coverage
run: php vendor/bin/phpunit --coverage-clover tests/build/logs/clover.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -208,6 +176,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN_LION_SECURITY }}

tests-infection:
if: false
runs-on: ubuntu-latest
name: Infection
needs: static-code-analysis
Expand All @@ -219,16 +188,9 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, gd, zip

- name: Restore composer.lock from cache
uses: actions/cache@v4
with:
path: composer.lock
key: php-composer-lock-${{ runner.os }}-${{ github.run_id }}
restore-keys: php-composer-lock-${{ runner.os }}-${{ github.run_id }}

- name: Restore vendor directory from cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.4-apache
FROM php:8.5-apache

ARG DEBIAN_FRONTEND=noninteractive
# ----------------------------------------------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lion/security",
"description": "Library created with the function of implementing AES, RSA and JWT Security functions for PHP.",
"description": "Library created with the function of implementing AES, RSA and JWT security features for PHP.",
"type": "library",
"license": "MIT",
"homepage": "https://dev.lion-packages.com",
Expand All @@ -24,10 +24,10 @@
}
},
"require": {
"php": ">=8.4",
"php": ">=8.5",
"ext-openssl": "*",
"firebase/php-jwt": "^6.1",
"vlucas/valitron": "^1.4",
"ext-openssl": "*"
"vlucas/valitron": "^1.4"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.8",
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
services:
app:
container_name: security-app
php:
container_name: security-php
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- ./:/var/www/html

networks:
lion:
driver: bridge