up: update some parser class #389
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit-Tests | |
# https://docs.github.com/cn/actions/reference/workflow-syntax-for-github-actions | |
on: | |
push: | |
paths: | |
- '**.php' | |
- 'composer.json' | |
- '**.yml' | |
jobs: | |
test: | |
name: Test on php ${{ matrix.php}} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.1, 8.2] # 7.2,7.4,8.0, | |
os: [ubuntu-latest, macOS-latest] # windows-latest, | |
# include: # will not testing on php 7.2 | |
# - os: 'ubuntu-latest' | |
# php: '7.2' | |
# phpunit: '8.5.13' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set ENV vars | |
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable | |
run: | | |
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV | |
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV | |
- name: Display Env | |
run: env | |
# usage refer https://github.com/shivammathur/setup-php | |
- name: Setup PHP | |
timeout-minutes: 5 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php}} | |
tools: pecl, php-cs-fixer, phpunit:${{ matrix.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: Install dependencies | |
run: composer update --no-progress -W | |
# 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: | | |
phpunit | |
php bin/kite -V | |
php bin/kite -h | |
# - name: Test run with swoole-cli | |
# if: ${{ matrix.os == 'ubuntu-latest' && matrix.php == '8.0' }} | |
# run: | | |
# wget -c https://github.com/swoole/swoole-src/releases/download/v4.8.7/swoole-cli-v4.8.7-linux-x64.tar.xz | |
# tar -zxvf swoole-cli-v4.8.7-linux-x64.tar.xz | |
# ./swoole-cli | |
# ./swoole-cli bin/kite | |
# git status && git log -1 && git fetch --tags --force | |
# git status && git log -1 && git fetch --prune --unshallow | |
# git status && git log -1 && git fetch --depth=500 --tags --force | |
- name: Test build Phar and run | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.php == '8.0' }} | |
run: | | |
php -d phar.readonly=0 bin/kite --debug 4 phar:pack -o kite-latest.phar --no-progress | |
php kite-latest.phar self info | |
mv kite-latest.phar tmp/kite-latest.phar | |
cd tmp && php kite-latest.phar self info |