forked from aws/aws-sdk-php
-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (91 loc) · 3.57 KB
/
Copy pathtests.yml
File metadata and controls
100 lines (91 loc) · 3.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Unit Tests (Linux)
# whenever master has a PR or is pushed to
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
run:
runs-on: ubuntu-latest
strategy:
# for each of the following versions of PHP, with and without --prefer-lowest
matrix:
include:
- php-versions: '8.1'
composer-options: ''
- php-versions: '8.1'
composer-options: '--prefer-lowest'
- php-versions: '8.2'
composer-options: ''
- php-versions: '8.2'
composer-options: '--prefer-lowest'
- php-versions: '8.3'
composer-options: ''
- php-versions: '8.3'
composer-options: '--prefer-lowest'
- php-versions: '8.4'
composer-options: ''
- php-versions: '8.4'
composer-options: '--prefer-lowest'
- php-versions: '8.5'
composer-options: ''
# set the name for each job
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }}
# set up environment variables used by unit tests
env:
AWS_ACCESS_KEY_ID: foo
AWS_SECRET_ACCESS_KEY: bar
AWS_CSM_ENABLED: false
AWS_SUPPRESS_PHP_DEPRECATION_WARNING: true
steps:
# sets up the correct version of PHP with necessary config options
- name: Setup PHP with JIT
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
coverage: none
php-version: ${{ matrix.php-versions }}
ini-values: memory_limit=4G, phar.readonly=false, opcache.enable=1, opcache.enable_cli=1, opcache.jit=tracing, opcache.jit_buffer_size=128M
# checkout the codebase from github
- name: Checkout codebase
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
# validate composer files
- name: Validate composer.json and composer.lock
run: composer validate
# get dependencies
- name: Install dependencies
run: |
if [[ "${{ matrix.composer-options }}" == "--prefer-lowest" ]]; then
# PHP 8.3+ needs PSR HTTP Message 2.0+ and compatible Guzzle packages
if [[ "${{ matrix.php-versions }}" == "8.3" ]] || [[ "${{ matrix.php-versions }}" == "8.4" ]]; then
composer update ${{ matrix.composer-options }} --no-interaction --prefer-dist --with-all-dependencies
composer update psr/http-message guzzlehttp/psr7 guzzlehttp/guzzle --with-all-dependencies --no-interaction
if [[ "${{ matrix.php-versions }}" == "8.4" ]]; then
composer update phpunit/phpunit:^10.0 --with-all-dependencies --no-interaction
fi
else
composer update ${{ matrix.composer-options }} --no-interaction --prefer-dist --with-all-dependencies
fi
else
composer update ${{ matrix.composer-options }} --no-interaction --prefer-dist
fi
# run tests
- name: Run test suite
run: make test
# static analysis
- name: Static analysis
run: |
composer require --dev nette/neon "^3.4.4" phpstan/phpstan "2.2.2" --ignore-platform-req=php --update-with-all-dependencies
vendor/bin/phpstan analyse src
# generate package
- if: ${{ matrix.composer-options == '' }}
name: Package generation
run: |
composer config platform.php 8.1
composer update
make package