Skip to content

Commit

Permalink
Merge branch 'master' into add-attribute-route
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz authored Nov 2, 2024
2 parents 5ba16dd + 697842d commit e648a51
Show file tree
Hide file tree
Showing 119 changed files with 36,813 additions and 1,021 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/blog-api_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog-api/psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'blog-api/docs/**'
- 'blog-api/README.md'
Expand All @@ -34,7 +35,7 @@ jobs:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
extensions: fileinfo, pdo, pdo_sqlite, intl
extensions: fileinfo, pdo, pdo_sqlite, intl, pcntl
key: cache-v1
YII_C3: true
working_directory: blog-api
Expand All @@ -48,8 +49,7 @@ jobs:
- windows-latest

php:
- 8.1
- 8.2
- 8.3

steps:
- name: Checkout
Expand Down Expand Up @@ -95,18 +95,5 @@ jobs:
working-directory: ${{ env.working_directory }}

- name: Run tests codeception
if: matrix.os != 'ubuntu-latest' || matrix.php != '8.0'
run: vendor/bin/codecept run
working-directory: ${{ env.working_directory }}

- name: Run tests codeception with coverage
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: vendor/bin/codecept run --coverage-xml
working-directory: ${{ env.working_directory }}

- name: Upload coverage to codecov
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
uses: codecov/codecov-action@v3
with:
file: tests/_output/coverage.xml
working-directory: ${{ env.working_directory }}
3 changes: 2 additions & 1 deletion .github/workflows/blog-api_dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog-api/psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'blog-api/docs/**'
- 'blog-api/README.md'
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- ubuntu-latest

php:
- 8.1
- 8.3

steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/blog-api_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog-api/phpunit.xml.dist'

push:
branches: ['master']
paths-ignore:
- 'blog-api/docs/**'
- 'blog-api/README.md'
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- ubuntu-latest

php:
- 8.1
- 8.3

steps:
- name: Checkout
Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/blog_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog/psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'blog/docs/**'
- 'blog/README.md'
Expand All @@ -37,7 +38,7 @@ jobs:
extensions: fileinfo, pdo, pdo_sqlite, intl
key: cache-v1
YII_C3: true
working_directory: blog-api
working_directory: blog

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

Expand All @@ -48,8 +49,7 @@ jobs:
- windows-latest

php:
- 8.1
- 8.2
- 8.3

steps:
- name: Checkout
Expand Down Expand Up @@ -94,19 +94,10 @@ jobs:
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
working-directory: ${{ env.working_directory }}

- name: Run tests codeception
if: matrix.os != 'ubuntu-latest' || matrix.php != '8.0'
run: vendor/bin/codecept run
- name: Install dependencies with npm
run: npm update
working-directory: ${{ env.working_directory }}

- name: Run tests codeception with coverage
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
run: vendor/bin/codecept run --coverage-xml
- name: Run tests codeception
run: vendor/bin/codecept run
working-directory: ${{ env.working_directory }}

- name: Upload coverage to codecov
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.0'
uses: codecov/codecov-action@v3
with:
file: tests/_output/coverage.xml
working-directory: ${{ env.working_directory }}
3 changes: 2 additions & 1 deletion .github/workflows/blog_dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog/psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'blog/docs/**'
- 'blog/README.md'
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- ubuntu-latest

php:
- 8.1
- 8.3

steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/blog_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'blog/phpunit.xml.dist'

push:
branches: ['master']
paths-ignore:
- 'blog/docs/**'
- 'blog/README.md'
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- ubuntu-latest

php:
- 8.1
- 8.3

steps:
- name: Checkout
Expand Down
9 changes: 7 additions & 2 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
preset: psr12
risky: true

version: 8
version: 8.1

finder:
exclude:
Expand Down Expand Up @@ -60,7 +60,6 @@ enabled:
- phpdoc_order
- phpdoc_property
- phpdoc_scalar
- phpdoc_separation
- phpdoc_singular_inheritdoc
- phpdoc_trim
- phpdoc_trim_consecutive_blank_line_separation
Expand All @@ -82,3 +81,9 @@ enabled:
- trailing_comma_in_multiline_array
- unalign_double_arrow
- unalign_equals
- empty_loop_body_braces
- integer_literal_case
- union_type_without_spaces

disabled:
- function_declaration
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Yii 3 Demo Code
===============

This repository contains the code for the Yii 3 demo projects: <https://demo.yiiframework.com>

Deployment
----------

### Manually Renew SSL Cert

docker-compose run certbot
docker-compose restart gateway
4 changes: 4 additions & 0 deletions blog-api/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.php]
ij_php_space_before_short_closure_left_parenthesis = false
ij_php_space_after_type_cast = true

[*.md]
trim_trailing_whitespace = false

Expand Down
1 change: 1 addition & 0 deletions blog-api/.env.test
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
YII_ENV=test
YII_DEBUG=true
BASE_URL=/
2 changes: 0 additions & 2 deletions blog-api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Thumbs.db
# composer vendor dir
/vendor

/composer.lock

# composer itself is not needed
composer.phar

Expand Down
40 changes: 0 additions & 40 deletions blog-api/.scrutinizer.yml

This file was deleted.

19 changes: 19 additions & 0 deletions blog-api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
init: composer-update up

up:
docker-compose up -d
down:
docker-compose down

composer:
docker-compose run php composer $(filter-out $@, $(MAKECMDGOALS))
composer-update:
docker-compose run php composer update

yii3:
docker-compose run php ./yii $(filter-out $@, $(MAKECMDGOALS))

test:
docker-compose run php ./vendor/bin/codecept run
psalm:
docker-compose run php ./vendor/bin/psalm
8 changes: 3 additions & 5 deletions blog-api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/yiisoft" target="_blank">
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px">
<img src="https://yiisoft.github.io/docs/images/yii_logo.svg" height="100px" alt="Yii">
</a>
<h1 align="center">Yii Framework API Demo Project</h1>
<br>
Expand All @@ -9,7 +9,6 @@
[![Latest Stable Version](https://poser.pugx.org/yiisoft/demo-api/v/stable.png)](https://packagist.org/packages/yiisoft/demo-api)
[![Total Downloads](https://poser.pugx.org/yiisoft/demo-api/downloads.png)](https://packagist.org/packages/yiisoft/demo-api)
[![Build status](https://github.com/yiisoft/demo-api/workflows/build/badge.svg)](https://github.com/yiisoft/demo-api/actions?query=workflow%3Abuild)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yiisoft/demo-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yiisoft/demo-api/?branch=master)
[![static analysis](https://github.com/yiisoft/demo-api/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/demo-api/actions?query=workflow%3A%22static+analysis%22)

API Demo application for Yii 3.
Expand Down Expand Up @@ -40,13 +39,13 @@ Change ownership of the app directory to web group:
chown -R :www-data .
```

Usually the application is available at http://localhost:8080.
Usually the application is available at <http://localhost:8080>.

Authorization is performed via the `X-Api-Key` header.

## API documentation

API documentation is available at `/docs`. It is built from OpenAPI annotations (`@OA`).
API documentation is available at `/docs`. It is built from OpenAPI attributes (`#[OA\ ... ]`).
See [Swagger-PHP documentation](https://zircote.github.io/swagger-php/Getting-started.html#write-annotations) for details
on how to annotate your code.

Expand All @@ -56,7 +55,6 @@ on how to annotate your code.
./vendor/bin/codecept run
```


## Static analysis

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
Expand Down
Loading

0 comments on commit e648a51

Please sign in to comment.