Skip to content

Commit ad38428

Browse files
authored
Merge pull request #70 from ulue/dev2
2 parents 92b31d7 + 780391e commit ad38428

File tree

5 files changed

+191
-1
lines changed

5 files changed

+191
-1
lines changed

.github/ISSUE_TEMPLATE/config.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Swoft Issues
4+
url: https://github.com/swoft-cloud/swoft/issues
5+
about: Please report security vulnerabilities here. 请打开此页面报告bug或改进问题!
6+
- name: Swoft Development
7+
url: https://github.com/swoft-cloud/swoft-component
8+
about: Participate in contributing swoft code, please jump to this project. 参与贡献swoft代码,请跳转到这个项目
9+
- name: Swoft 中文文档
10+
url: https://swoft.org
11+
about: Please ask and answer questions here. swoft 2.0新版风格中文文档请访问此网站。
12+
- name: Swoft English Documents
13+
url: http://swoft.io
14+
about: Please report security vulnerabilities here. swoft英文文档或者旧版风格文档请访问此网站。

.github/PULL_REQUEST_TEMPLATE.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# PR
2+
3+
- 请不要提交PR到各个组件仓库,它们都是 **只读的**
4+
- 核心组件的 **开发仓库****[swoft/swoft-component][core]**
5+
- 扩展组件的 **开发仓库****[swoft/swoft-ext][ext]**
6+
-`fork` 对应的 **开发仓库**,修改后,请把你的PR提交到对应的开发仓库
7+
8+
> 发布版本时官方会将代码同步到各个子仓库。因此,切记不要往子仓库发PR。
9+
10+
## 发起PR时的注意事项
11+
12+
开发组非常欢迎各位向我们提交PR(_Pull Request_),但是为了保证代码质量和统一的风格,
13+
向官方的主仓库 [swoft/swoft][main]**开发仓库** 贡献代码时需要注意代码和commit格式
14+
15+
### Commit Message
16+
17+
- commit message 只能是英文信息
18+
- 请尽量保证commit message是有意义的说明
19+
- 最好以 `add:` `update:` `fix:` 等关键字开头
20+
21+
### 代码风格
22+
23+
- 提交的PHP代码 **必须** 遵循 PSR-2 代码风格
24+
- 合理且有意义的类、方法、变量命名
25+
- 适当的注释,合理的使用空行保持代码的简洁,易于阅读
26+
- 不要包含一些无意义的信息 例如 `@author` 等(_提交者是能够从commit log里看到的_)
27+
28+
------------------
29+
30+
> English Version (_translate by Google_)
31+
32+
The development team welcomes you to submit PR (_Pull Request_) to us, but to ensure code quality and uniform style,
33+
go to the official main repository [swoft/swoft][main] and Development repository, Note the code and commit format when contributing code
34+
35+
## Precautions when initiating PR
36+
37+
- Please do not submit PR to each sub-repository, they are all read-only
38+
- The _development repository_ for the core components is **[swoft/swoft-component][core]**
39+
- The _development repository_ for extension components is **[swoft/swoft-ext][ext]**
40+
- Please `fork` the corresponding development warehouse. After modification, please submit your PR to the corresponding development warehouse.
41+
42+
> Officially syncs code to individual sub-warehouses when new versions are released
43+
44+
### Commit Message
45+
46+
- the commit message can only be in English
47+
- Please try to ensure that the commit message is meaningful
48+
- it is best to start with the keyword `add:` `update:` `fix:`
49+
50+
### Code Style
51+
52+
- Submitted PHP code **Must** Follow PSR-2 code style
53+
- Reasonable and meaningful class, method, variable naming
54+
- Appropriate comments, reasonable use of blank lines to keep the code simple and easy to read
55+
- Don't include some meaningless information such as `@author`, etc. (_author is that can be seen from the commit log_)
56+
57+
58+
[main]: https://github.com/swoft-cloud/swoft
59+
[core]: https://github.com/swoft-cloud/swoft-component
60+
[ext]: https://github.com/swoft-cloud/swoft-ext

.github/workflows/php.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Github actions for swoft component tests
3+
# https://github.com/marketplace?type=actions
4+
#
5+
name: Unit-tests
6+
7+
on: [push, pull_request]
8+
9+
# usage refer https://github.com/shivammathur/setup-php
10+
jobs:
11+
test:
12+
name: Test on php ${{ matrix.php}} and ${{ matrix.os }} OS
13+
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 20
15+
env:
16+
SWOFT_DEBUG: 0
17+
strategy:
18+
fail-fast: true # fast fail
19+
matrix:
20+
php: [7.2, 7.3, 7.4, 8.0]
21+
os: [ubuntu-latest] # , macOS-latest, windows-latest
22+
swoole-versions: [''] # latest
23+
include:
24+
- os: 'ubuntu-latest'
25+
php: '7.1'
26+
swoole-versions: '-4.5.11'
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
# usage refer https://github.com/shivammathur/setup-php
31+
- name: Setup PHP
32+
timeout-minutes: 5
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php}}
36+
extensions: mbstring, dom, fileinfo, mysql, openssl, redis, swoole${{ matrix.swoole-versions }} #optional, setup extensions
37+
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
38+
coverage: none #optional, setup coverage driver: xdebug, none
39+
40+
- name: Display swoole extensions
41+
timeout-minutes: 1
42+
run: php --ri swoole
43+
# sudo pecl install -f swoole
44+
# echo 'no' | pecl install -f redis
45+
# sudo pecl update-channels && pecl install -f msgpack && pecl install -f igbinary && php -m
46+
47+
- name: Install dependencies
48+
run: composer install --no-progress --no-suggest
49+
50+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
51+
# Docs: https://getcomposer.org/doc/articles/scripts.md
52+
53+
- name: Run test suite
54+
run: composer run test

.github/workflows/release.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Tag-release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
release:
10+
name: Test on php ${{ matrix.php}}
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: [7.3]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Set ENV for github-release
23+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
24+
run: |
25+
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
26+
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
27+
28+
# usage refer https://github.com/shivammathur/setup-php
29+
- name: Setup PHP
30+
timeout-minutes: 5
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php}}
34+
tools: pecl, php-cs-fixer, phpunit
35+
extensions: mbstring, dom, fileinfo, mysql, openssl # , swoole-4.4.19 #optional, setup extensions
36+
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
37+
coverage: none #optional, setup coverage driver: xdebug, none
38+
39+
- name: Install dependencies # eg: v1.0.3
40+
run: |
41+
tag1=${GITHUB_REF#refs/*/}
42+
echo "release tag: ${tag1}"
43+
composer install --no-progress --no-suggest
44+
45+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
46+
# Docs: https://getcomposer.org/doc/articles/scripts.md
47+
48+
# - name: Build phar and send to github assets
49+
# run: |
50+
# echo $RELEASE_TAG
51+
# echo $RELEASE_NAME
52+
# php -d phar.readonly=0 bin/kite phar:pack -o kite-${RELEASE_TAG}.phar --no-progress
53+
# php kite-${RELEASE_TAG}.phar -V
54+
55+
# https://github.com/actions/create-release
56+
- uses: meeDamian/github-release@2.0
57+
with:
58+
gzip: false
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
tag: ${{ env.RELEASE_TAG }}
61+
name: ${{ env.RELEASE_TAG }}
62+
# files: kite-${{ env.RELEASE_TAG }}.phar

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "swoft/devtool",
33
"type": "library",
4-
"version": "v2.0.10",
4+
"version": "v2.0.11",
55
"keywords": [
66
"php",
77
"swoole",

0 commit comments

Comments
 (0)