-
-
Notifications
You must be signed in to change notification settings - Fork 19
88 lines (85 loc) · 2.29 KB
/
tests.yaml
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
name: tests
on:
push:
paths:
- "**"
- "!docs/**"
- "!.vscode/**"
- "!**.md"
pull_request:
paths:
- "**"
- "!docs/**"
- "!.vscode/**"
- "!**.md"
schedule:
- cron: '0 2 * * *'
env:
PHP_CS_FIXER_IGNORE_ENV: 1
jobs:
cs-fix:
name: PHP CS Fixer on PHP ${{ matrix.php }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [ubuntu-latest]
php: ['8.1']
max-parallel: 20
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: redis, pdo, pdo_mysql, bcmath, swoole
tools: phpize
coverage: none
- name: Setup Packages
run: composer update -o
- name: Check Composer Json
run: |
composer normalize --dry-run --no-update-lock
find ./src -name composer.json -exec composer normalize --dry-run --no-update-lock {} \;
- name: Run Cs Fixer
run: vendor/bin/php-cs-fixer fix $1 --dry-run --diff --verbose
tests:
needs: cs-fix
name: Test on PHP ${{ matrix.php }} with Swoole ${{ matrix.swoole }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [ubuntu-latest]
php: ['8.3', '8.2', '8.1']
swoole: ['5.1.6', '6.0.0']
# exclude:
# - php: '8.3'
# swoole: '5.0.3'
max-parallel: 20
fail-fast: false
env:
SW_VERSION: ${{ matrix.swoole }}
PHP_VERSION: ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: redis, pdo, pdo_mysql, bcmath ,swoole-${{ matrix.swoole }}
tools: phpize
coverage: none
# - name: Setup Swoole
# run: ./.travis/setup.swoole.sh
- name: Show PHP Information
run: php -v && php --ri swoole
- name: Setup Dependencies
run: composer update -o
- name: Run Analyse
run: composer analyse src
- name: Setup Services
run: ./.travis/setup.services.sh
- name: Run Test Cases
run: php vendor/bin/pest --parallel