Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
merge swoft-component
  • Loading branch information
JasonYH committed Jan 17, 2020
2 parents afb5726 + a59d4d7 commit a3bdbd9
Show file tree
Hide file tree
Showing 335 changed files with 4,186 additions and 3,372 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ trim_trailing_whitespace = false
[*.json]
indent_size = 2

[*.yml]
indent_size = 2

[*.html]
indent_size = 2

Expand Down
75 changes: 75 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Add 'kind/annotation' label to any change within the 'annotation' component
kind/annotation:
- src/annotation/**/*
# add label for 'aop' component
kind/aop:
- src/aop/**/*
# add label for 'bean' component
kind/bean:
- src/bean/**/*
# add label for 'config' component
kind/config:
- src/config/**/*
# add label for 'connection-pool' component
kind/connection-pool:
- src/connection-pool/**/*
# add label for 'console' component
kind/console:
- src/console/**/*
# add label for 'db' component
kind/db:
- src/db/**/*
# add label for 'error' component
kind/error:
- src/error/**/*
# add label for 'event' component
kind/event:
- src/event/**/*
# add label for 'framework' component
kind/framework:
- src/framework/**/*
# add label for 'http-message' component
kind/http-message:
- src/http-message/**/*
# add label for 'http-server' component
kind/http-server:
- src/http-server/**/*
# add label for 'i18n' component
kind/i18n:
- src/i18n/**/*
# add label for 'log' component
kind/log:
- src/log/**/*
# add label for 'process' component
kind/process:
- src/process/**/*
# add label for 'proxy' component
kind/proxy:
- src/proxy/**/*
# add label for 'redis' component
kind/redis:
- src/redis/**/*
# add label for 'rpc-server' component
kind/rpc-server:
- src/rpc-server/**/*
- src/rpc-client/**/*
- src/rpc/**/*
# add label for 'server' component
kind/server:
- src/server/**/*
# add label for 'stdlib' component
kind/stdlib:
- src/stdlib/**/*
# add label for 'task' component
kind/task:
- src/task/**/*
# add label for 'tcp-server' component
kind/tcp-server:
- src/tcp-server/**/*
- src/tcp/**/*
# add label for 'validator' component
kind/validator:
- src/validator/**/*
# add label for 'websocket-server' component
kind/websocket-server:
- src/websocket-server/**/*
75 changes: 75 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Add 'kind/annotation' label to any change within the 'annotation' component
kind/annotation:
- src/annotation/**/*
# add label for 'aop' component
kind/aop:
- src/aop/**/*
# add label for 'bean' component
kind/bean:
- src/bean/**/*
# add label for 'config' component
kind/config:
- src/config/**/*
# add label for 'connection-pool' component
kind/connection-pool:
- src/connection-pool/**/*
# add label for 'console' component
kind/console:
- src/console/**/*
# add label for 'db' component
kind/db:
- src/db/**/*
# add label for 'error' component
kind/error:
- src/error/**/*
# add label for 'event' component
kind/event:
- src/event/**/*
# add label for 'framework' component
kind/framework:
- src/framework/**/*
# add label for 'http-message' component
kind/http-message:
- src/http-message/**/*
# add label for 'http-server' component
kind/http-server:
- src/http-server/**/*
# add label for 'i18n' component
kind/i18n:
- src/i18n/**/*
# add label for 'log' component
kind/log:
- src/log/**/*
# add label for 'process' component
kind/process:
- src/process/**/*
# add label for 'proxy' component
kind/proxy:
- src/proxy/**/*
# add label for 'redis' component
kind/redis:
- src/redis/**/*
# add label for 'rpc-server' component
kind/rpc-server:
- src/rpc-server/**/*
- src/rpc-client/**/*
- src/rpc/**/*
# add label for 'server' component
kind/server:
- src/server/**/*
# add label for 'stdlib' component
kind/stdlib:
- src/stdlib/**/*
# add label for 'task' component
kind/task:
- src/task/**/*
# add label for 'tcp-server' component
kind/tcp-server:
- src/tcp-server/**/*
- src/tcp/**/*
# add label for 'validator' component
kind/validator:
- src/validator/**/*
# add label for 'websocket-server' component
kind/websocket-server:
- src/websocket-server/**/*
32 changes: 32 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md

name: Pull Request Labeler
on: [pull_request]

jobs:
label:
runs-on: ubuntu-latest

steps:
# - uses: TimonVS/pr-labeler-action@v3
# with:
# configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: PR Labeler
# uses: paulfantom/periodic-labeler@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_REPOSITORY: ${{ github.repository }}
# LABEL_MAPPINGS_FILE: .github/pr-labeler.yml

- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: ".github/pr-labeler.yml"
65 changes: 65 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Github actions for swoft component tests
# https://github.com/marketplace?type=actions
#
name: Unit-tests

on: [push, pull_request]

# usage refer https://github.com/shivammathur/setup-php
jobs:
test:
name: Test on php ${{ matrix.php}} and ${{ matrix.os }} OS
runs-on: ${{ matrix.os }}
timeout-minutes: 20
env:
SWOFT_DEBUG: 0
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: swoft123456
MYSQL_DATABASE: test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false # dont fast fail
matrix:
php: [7.1, 7.2, 7.3] # 7.4
os: [ubuntu-latest] # , macOS-latest, windows-latest

steps:
- uses: actions/checkout@v2
- name: Setup PHP
timeout-minutes: 5
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php}}
extensions: mbstring, dom, fileinfo, mysql, openssl, redis #optional, setup extensions
ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
coverage: none #optional, setup coverage driver: xdebug, none
pecl: true

- name: Install swoole extensions
timeout-minutes: 5
run: |
sudo pecl install -f swoole && php -m
# echo 'no' | pecl install -f redis
# sudo pecl update-channels && pecl install -f msgpack && pecl install -f igbinary && php -m

- name: Install dependencies
run: composer install --no-progress --no-suggest

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: | # && composer run test
pwd && ./phpunit.sh nodb
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ before_install:
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;'
install:
- echo 'no' | pecl install -f redis
- wget https://github.com/swoole/swoole-src/archive/v4.4.6.tar.gz -O swoole.tar.gz && mkdir -p swoole && tar -xf swoole.tar.gz -C swoole --strip-components=1 && rm swoole.tar.gz && cd swoole && phpize && ./configure && make -j$(nproc) && make install && cd -
- wget https://github.com/swoole/swoole-src/archive/v4.4.14.tar.gz -O swoole.tar.gz && mkdir -p swoole && tar -xf swoole.tar.gz -C swoole --strip-components=1 && rm swoole.tar.gz && cd swoole && phpize && ./configure && make -j$(nproc) && make install && cd -
- echo "extension = swoole.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

before_script:
Expand Down
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,31 @@ help:
update:
git checkout . && git pull

installcli: ## Install the swoft releasecli tool from github
installcli:
cd ~
git clone https://github.com/swoftlabs/swoft-releasecli
cd swoft-releasecli; \
ln -s $PWD/bin/releasecli /usr/local/bin/releasecli; \
chmod a+x bin/releasecli

updatecli: ## Update the swoft releasecli tool from github
updatecli:
cd ~/swoft-releasecli; \
git pull; \
chmod a+x bin/releasecli

addrmt: ## Add the remote repository address of each component to the local remote
addrmt:
php dtool.php git:addrmt --all
addrmt: update
releasecli git:addrmt --all

fpush: ## Push all update to remote sub-repo by git push with '--force'
fpush:
php dtool.php git:fpush --all
fpush: update
releasecli git:fpush --all

release: ## Release all sub-repo to new tag version and push to remote repo. eg: tag=v2.0.3
release:
php dtool.php tag:release --all -y -t $(TAG)
releasecli tag:release --all -y -t $(TAG)

sami: ## Gen classes docs by sami.phar
classdoc:
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Swoft Component

[![Actions Status](https://github.com/swoft-cloud/swoft-component/workflows/Unit-tests/badge.svg)](https://github.com/swoft-cloud/swoft-component/actions)
[![Build Status](https://travis-ci.org/swoft-cloud/swoft-component.svg?branch=master)](https://travis-ci.org/swoft-cloud/swoft-component)


This repository is used to manage all swoft core components.

## [中文说明](README.zh-CN.md)
Expand All @@ -20,7 +24,7 @@ Add require to `composer.json`

Install:

```json
```bash
composer update
```

Expand Down Expand Up @@ -57,6 +61,10 @@ phpdbg -dauto_globals_jit=Off -qrr /usr/local/bin/phpunit --coverage-text
phpdbg -dauto_globals_jit=Off -qrr run.php --coverage-text -c src/event/phpunit.xml
```

## Releases

Please see https://github.com/swoftlabs/swoft-releasecli

## Document

- [中文文档](https://www.swoft.org/docs)
Expand Down
Loading

0 comments on commit a3bdbd9

Please sign in to comment.