-
Notifications
You must be signed in to change notification settings - Fork 6
142 lines (126 loc) · 4.75 KB
/
test.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: "Test"
#
# Based on workflows from Composer:
#
# * https://github.com/composer/composer/blob/2.5.4/.github/workflows/continuous-integration.yml
# * https://github.com/composer/installers/blob/v2.2.0/.github/workflows/continuous-integration.yml
#
on:
workflow_dispatch:
push:
tags-ignore:
- '**'
pull_request:
tags-ignore:
- '**'
schedule:
# Twice monthly on 1st and 15th at 14:00 UTC.
#
# ┌───────────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌──── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌─ day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: '0 15 1,15 * *'
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
COMPOSER_UPDATE_FLAGS: ""
permissions:
contents: read
jobs:
tests:
name: "PHP ${{ matrix.php-version }} / Composer ${{ matrix.composer-version }} / ${{ matrix.os }}"
strategy:
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
composer-version:
- "2.5"
- "2.6"
- "2.7"
os:
- "ubuntu-latest"
experimental:
- false
include:
- php-version: "8.2"
composer-version: "2.3"
os: "ubuntu-latest"
experimental: false
- php-version: "8.2"
composer-version: "2.4"
os: "ubuntu-latest"
experimental: false
- php-version: "8.2"
composer-version: "preview"
os: "ubuntu-latest"
experimental: true
- php-version: "8.2"
composer-version: "snapshot"
os: "ubuntu-latest"
experimental: true
- php-version: "8.2"
composer-version: "v2"
os: "windows-latest"
experimental: false
- php-version: "8.4"
composer-version: "v2"
os: "ubuntu-latest"
experimental: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Prepare git environment"
run: "git config --global user.name composer && git config --global user.email [email protected]"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl, zip"
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On"
php-version: "${{ matrix.php-version }}"
tools: composer:${{ matrix.composer-version }}, phpunit-bridge
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache dependencies installed with Composer"
uses: actions/cache@v4
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: ${{ runner.os }}-composer-${{ matrix.composer-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.composer-version }}-
- name: Install Composer dependencies
shell: bash
run: |
# Resolve dependencies according to Composer: ${{ matrix.composer-version }}
if [ "${{ matrix.composer-version }}" == "snapshot" ]; then
composer config platform --unset
composer config minimum-stability dev
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer="dev-main"
elif [ "${{ matrix.composer-version }}" == "preview" ]; then
composer config platform --unset
composer config minimum-stability alpha
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer
elif [ "${{ matrix.composer-version }}" == "v2" ]; then
composer install ${{ env.COMPOSER_FLAGS }}
else
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer="~${{ matrix.composer-version }}.0"
fi
- name: Install PHPUnit
run: "./vendor/bin/simple-phpunit install"
- name: "Run tests"
run: "./vendor/bin/simple-phpunit --verbose"