-
Notifications
You must be signed in to change notification settings - Fork 438
110 lines (106 loc) · 3.36 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Test Suite
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
php: [ "8.0", "8.1", "8.2", "8.3" ]
extensions: ["grpc-1.54.0"]
type: ["Unit Test"]
include:
- platform: "ubuntu-latest"
php: "8.0"
extensions: "protobuf,grpc-1.54.0"
type: "Unit Test + protobuf extension"
name: PHP ${{ matrix.php }} ${{ matrix.type }} (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: sodium,${{ matrix.extensions }}
key: cache-key-1 # increment to bust the cache
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: ${{ matrix.php }}
extensions: sodium,${{ matrix.extensions }}
- name: Install Dependencies
uses: nick-invision/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: composer --no-interaction --no-ansi --no-progress update
- if: ${{ matrix.platform == 'windows-latest' }}
name: Run Unit Test Suite (Windows)
run: |
vendor/bin/phpunit -c phpunit.xml.dist
if ( "$?" -ne "0" )
{
echo "*** RETRYING FLAKEY PHPUNIT ON WINDOWS ***"
vendor/bin/phpunit -c phpunit.xml.dist
}
- if: ${{ matrix.platform != 'windows-latest' }}
name: Run Unit Test Suite
run: |
vendor/bin/phpunit -c phpunit.xml.dist
- if: ${{ matrix.platform != 'windows-latest' }}
name: Run Snippet Test Suite
run: |
vendor/bin/phpunit -c phpunit-snippets.xml.dist --verbose
test_packages:
name: Package Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: '8.1'
extensions: grpc-1.63.0
- name: Run Package Test Suites
run: bash .github/run-package-tests.sh
test_packages_lowest:
name: Package Tests (Lowest Dependencies)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: '8.1'
extensions: grpc-1.63.0
- name: Run Package Test Suites
env:
PREFER_LOWEST: ${{ github.event.pull_request.user.login == 'release-please[bot]' && '--prefer-lowest-strict' || '--prefer-lowest' }}
run: bash .github/run-package-tests.sh $PREFER_LOWEST
test_dev_commands:
name: Dev Commands Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: "8.1"
- name: "Install dependencies"
run: composer --no-interaction --no-ansi --no-progress update -d dev
- name: Run Dev Unit Test Suite
run: dev/vendor/bin/phpunit -c dev/phpunit.xml.dist