Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit. #1

Merged
merged 26 commits into from
Oct 17, 2023
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
82 changes: 56 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'
- pull_request
- push

name: build

jobs:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.1', '8.2', '8.3']
tests:
name: PHP ${{ matrix.php }}-redis-${{ matrix.redis }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.1
- 8.2
- 8.3

redis:
- 4
- 5
- 6

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

- name: Start Redis v4
uses: superchargejs/[email protected]
with:
redis-version: ${{ matrix.redis }}

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, intl, redis
ini-values: date.timezone='UTC'
tools: composer:v2, pecl

- name: Install dependencies with Composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Run tests with phpunit.
if: matrix.php != '8.1'
run: vendor/bin/phpunit --colors=always

- name: Run tests with phpunit and generate coverage.
if: matrix.php == '8.1'
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
name: static analysis

jobs:
psalm:
phpstan:
uses: php-forge/actions/.github/workflows/phpstan.yml@main
with:
os: >-
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<p align="center">
<a href="https://github.com/yii2-extensions/template" target="_blank">
<a href="https://github.com/yii2-extensions/redis" target="_blank">
<img src="https://www.yiiframework.com/image/yii_logo_light.svg" height="100px;">
</a>
<h1 align="center">Yii2-Template.</h1>
<br>
<h1 align="center">Redis</h1>
</p>

<p align="center">
Expand All @@ -13,21 +12,21 @@
<a href="https://github.com/yiisoft/yii2/tree/2.2" target="_blank">
<img src="https://img.shields.io/badge/Yii2%20version-2.2-blue" alt="yii2-version">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii2-extensions/template/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
<a href="https://github.com/yii2-extensions/redis/actions/workflows/build.yml" target="_blank">
<img src="https://github.com/yii2-extensions/redis/actions/workflows/build.yml/badge.svg" alt="PHPUnit">
</a>
<a href="https://codecov.io/gh/yii2-extensions/template" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/template/branch/main/graph/badge.svg?token=MF0XUGVLYC" alt="Codecov">
<a href="https://codecov.io/gh/yii2-extensions/redis" target="_blank">
<img src="https://codecov.io/gh/yii2-extensions/redis/graph/badge.svg?token=Zrd1BYuq4p" alt="Codecov">
</a>
<a href="https://github.com/yii2-extensions/redis/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii2-extensions/redis/actions/workflows/static.yml/badge.svg" alt="PHPStan">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/static.yml" target="_blank">
<img src="https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg" alt="PHPStan">
<a href="https://github.com/yii2-extensions/redis/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-1-blue" alt="PHPStan level">
</a>
<a href="https://github.com/yii2-extensions/template/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/badge/PHPStan%20level-2-blue" alt="PHPStan level">
<a href="https://github.styleci.io/repos/706293414?branch=initial-commit" target="_blank">
<img src="https://github.styleci.io/repos/706293414/shield?branch=initial-commit" alt="Code style">
</a>
<a href="https://github.styleci.io/repos/698621511?branch=main" target="_blank">
<img src="https://github.styleci.io/repos/698621511/shield?branch=main" alt="Code style">
</a>
</p>

## Requirements
Expand Down
5 changes: 5 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"symbol-whitelist": [
"YII_DEBUG"
]
}
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{
"name": "yii2/template",
"type": "library",
"description": "_____",
"name": "yii2-extensions/redis",
"type": "yii2-extension",
"description": "Redis Cache, Session and ActiveRecord for the Yii framework",
"keywords": [
"_____"
"yii2",
"redis",
"active-record",
"cache",
"session"
],
"license": "mit",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-mbstring": "*",
"yiisoft/yii2": "^2.2"
},
"require-dev": {
Expand All @@ -19,12 +25,12 @@
},
"autoload": {
"psr-4": {
"yii\\template\\": "src"
"yii\\redis\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"yii\\template\\tests\\": "tests"
"yiiunit\\extensions\\redis\\": "tests"
}
},
"extra": {
Expand All @@ -40,7 +46,6 @@
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin",
"phpstan": "phpstan",
"test": "phpunit"
},
Expand Down
16 changes: 0 additions & 16 deletions infection.json.dist

This file was deleted.

2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- YII_ENV_PROD
- YII_ENV_TEST

level: 2
level: 1

paths:
- src
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="vendor/autoload.php"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
Expand All @@ -11,7 +11,7 @@
stopOnFailure="false"
>
<testsuites>
<testsuite name="Template">
<testsuite name="Yii2-Redis">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
Loading