forked from swoft-cloud/swoft-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (80 loc) · 3.51 KB
/
php.yml
File metadata and controls
91 lines (80 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: PHP-CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Test on php ${{ matrix.php}} and ${{ matrix.os }} OS
runs-on: ${{ matrix.os }}
timeout-minutes: 20
env:
SWOFT_DEBUG: 0
strategy:
fail-fast: true
matrix:
php: [7.1, 7.2, 7.3, 7.4]
os: [ubuntu-latest] # , macOS-latest, windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP Env
timeout-minutes: 5
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php}}
tools: pecl, php-cs-fixer, phpunit
extensions: mbstring, dom, fileinfo, mysql, openssl, igbinary, redis # , swoole-4.4.19 #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
- name: Setup swoole extensions
timeout-minutes: 5
run: |
sudo pecl install -f swoole-4.4.19
php -m
# echo 'no' | pecl install -f redis
# sudo pecl update-channels && pecl install -f msgpack && pecl install -f igbinary && php -m
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --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 tests and build phar
run: |
composer test0
php -d phar.readonly=0 bin/swoftcli phar:pack -o=swoftcli.phar --no-progress
# - name: Deploy release assets
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# if: matrix.php == '7.3' && matrix.os == 'ubuntu-latest' # run once
# uses: xresloader/upload-to-github-release@v1
# with:
# # 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.
# file: swoftcli.phar # default is
# # If you need to overwrite existing files, add overwrite: true to the with.
# overwrite: false # optional, default is false
# # 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.
# draft: false # optional, default is true
# # The resultant deployment is a Prerelease. This gives you an opportunity to examine and edit the prerelease.
# prerelease: false # optional, default is false
# # With tags: true, your Releases deployment will trigger if and only if the build is a tagged build.
# tags: true # optional, default is false
# # Only work on these branches(splited by semicolon), set to nothing to accept all branches.
# branches: master # optional, default is
# # With verbose: true, be verbose.
# verbose: false # optional, default is false
# # Set custom tag name.
# tag_name: '' # optional, default is
# # If try to update latest release.
# update_latest_release: false # optional, default is false