forked from LinioPay/hmmmath
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (99 loc) · 3.42 KB
/
test.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
#name: PHP ${{ matrix.php-version }}
name: PHP ${{ matrix.php }} - ${{ matrix.phpunit }} - ${{ matrix.stability }}
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
phpunit: ['9.6.16']
# stability: [prefer-lowest, prefer-stable]
stability: [prefer-dist]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, :php-psr #sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, lzf, zstd, lz4, memcached, gmp,
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
#env:
#REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4
#REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev
# - name: Validate composer.json and composer.lock
# run: composer validate --strict
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
#key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
#restore-keys: ${{ runner.os }}-composer-
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-
# - name: Install dependencies
# run: composer install --prefer-dist
- name: Set PHPUnit
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 10
command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 10
command: composer update --${{ matrix.stability }} --no-interaction --no-progress
- name: Run Tests
run: vendor/bin/phpunit
#name: Test
#
#on: [push, pull_request]
#
#jobs:
# test:
# name: PHP ${{ matrix.php-version }}
#
# runs-on: ubuntu-22.04
#
# strategy:
# matrix:
# php-version:
# - 7.3
# - 7.4
# - 8.0
# - 8.1
# - 8.2
# - 8.3
#
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Install PHP with extensions
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-version }}
# coverage: pcov
# tools: composer:v2
#
# - name: Install Composer dependencies
# uses: ramsey/composer-install@v1
# with:
# composer-options: --prefer-dist
#
# - name: Run Tests
# run: vendor/bin/phpunit