-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.36 KB
/
php.yml
File metadata and controls
80 lines (70 loc) · 2.36 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
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}}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
php: [8.3, 8.1, 8.2, 8.4]
# os: [ubuntu-latest] # , macOS-latest, windows-latest,
coverage: ['none']
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ~/.composer/cache/files
key: ${{ matrix.php }}
- 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: php-cs-fixer, phpunit:${{ matrix.phpunit }} # pecl,
extensions: mbstring # , swoole-4.4.19 #optional, setup extensions
coverage: ${{ matrix.coverage }} #optional, setup coverage driver: xdebug, none
- name: Install dependencies
run: composer update --no-progress
# phpunit -v --debug
# phpunit --coverage-clover ./test/clover.info
# phpdbg -dauto_globals_jit=Off-qrr $(which phpunit) --coverage-clover ./test/clover.info
- name: Run test suite
run: |
php example/flags-demo.php -h
php example/sflags-demo.php --help
phpunit
# - name: Coveralls parallel
# uses: coverallsapp/github-action@master
# if: matrix.coverage == 'xdebug'
# with:
# github-token: ${{ secrets.github_token }}
# path-to-lcov: ./test/clover.info
# flag-name: run-${{ matrix.php }}
# parallel: true
#
# finish:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.github_token }}
# parallel-finished: true