Skip to content

Commit 20c03b5

Browse files
committed
update swoole version add github actions
1 parent 45a28f2 commit 20c03b5

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ trim_trailing_whitespace = true
1313
[*.md]
1414
trim_trailing_whitespace = false
1515

16+
[*.yml]
17+
indent_size = 2
18+
1619
[*.json]
1720
indent_size = 2
1821

.github/workflow/php.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: PHP-CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
name: Test on php ${{ matrix.php}} and ${{ matrix.os }} OS
12+
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 20
14+
env:
15+
SWOFT_DEBUG: 0
16+
strategy:
17+
fail-fast: true # dont fast fail
18+
matrix:
19+
php: [7.1, 7.2, 7.3, 7.4]
20+
os: [ubuntu-latest] # , macOS-latest, windows-latest
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Install swoole extensions
26+
timeout-minutes: 5
27+
run: |
28+
sudo pecl install -f swoole-4.4.19 && php -m
29+
# echo 'no' | pecl install -f redis
30+
# sudo pecl update-channels && pecl install -f msgpack && pecl install -f igbinary && php -m
31+
32+
- name: Validate composer.json and composer.lock
33+
run: composer validate
34+
35+
- name: Cache Composer packages
36+
id: composer-cache
37+
uses: actions/cache@v2
38+
with:
39+
path: vendor
40+
key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-node-
43+
44+
- name: Install dependencies
45+
if: steps.composer-cache.outputs.cache-hit != 'true'
46+
run: composer install --prefer-dist --no-progress --no-suggest
47+
48+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
49+
# Docs: https://getcomposer.org/doc/articles/scripts.md
50+
51+
- name: Run test suite
52+
run: composer test0
53+
54+
- name: Deploy release assets
55+
If: matrix.php == '7.3' && matrix.os == 'ubuntu-latest' # run once
56+
run: php -d phar.readonly=0 bin/swoftcli phar:pack -o=swoftcli.phar --no-progress
57+
uses: xresloader/upload-to-github-release@v1
58+
with:
59+
# The files or file patterns to upload. You can upload multiple files by split them by semicolon. You can use the glob pattern to find the files.
60+
file: swoftcli.phar # default is
61+
# If you need to overwrite existing files, add overwrite: true to the with.
62+
overwrite: # optional, default is false
63+
# The resultant deployment is a draft Release that only repository collaborators can see. This gives you an opportunity to examine and edit the draft release.
64+
draft: false # optional, default is true
65+
# The resultant deployment is a Prerelease. This gives you an opportunity to examine and edit the prerelease.
66+
prerelease: false # optional, default is false
67+
# With tags: true, your Releases deployment will trigger if and only if the build is a tagged build.
68+
tags: true # optional, default is false
69+
# Only work on these branches(splited by semicolon), set to nothing to accept all branches.
70+
branches: master # optional, default is
71+
# With verbose: true, be verbose.
72+
verbose: # optional, default is false
73+
# Set custom tag name.
74+
tag_name: # optional, default is
75+
# If try to update latest release.
76+
update_latest_release: # optional, default is false

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ php:
44
- '7.1'
55
- '7.2'
66
- '7.3'
7+
- '7.4'
78

89
install:
910
# - echo 'no' | pecl install -f redis
10-
- wget https://github.com/swoole/swoole-src/archive/v4.4.12.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 -
11+
- wget https://github.com/swoole/swoole-src/archive/v4.4.19.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 -
1112
- echo "extension = swoole.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
1213

1314
before_script:

0 commit comments

Comments
 (0)