-
-
Notifications
You must be signed in to change notification settings - Fork 344
171 lines (141 loc) · 5.75 KB
/
run-tests.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Run Standard Tests
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!master'
jobs:
test-laravel10:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ubuntu-24.04]
php: [8.1, 8.2, 8.3, 8.4]
laravel: [10.*]
stability: [prefer-dist]
name: PHP-${{ matrix.php }} - Laravel-10
env:
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.extensionKey }}
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: phpunit:9.6
ini-values: memory_limit=512M
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-
- name: Add token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer config github-oauth.github.com $GITHUB_TOKEN
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update
- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run Unit Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage
test-laravel11:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ubuntu-24.04]
php: [8.2, 8.3, 8.4]
laravel: [11.*]
stability: [prefer-dist]
name: PHP-${{ matrix.php }} - Laravel-11
env:
extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: ${{ env.extensionKey }}
- name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
restore-keys: ${{ matrix.os }}-${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
tools: phpunit:latest
ini-values: memory_limit=512M
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-PHP${{ matrix.php }}-L${{ matrix.laravel }}-composer-
- name: Add token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer config github-oauth.github.com $GITHUB_TOKEN
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer require "laravel/framework:${{ matrix.laravel }}.*" --no-interaction --no-update
- name: Update dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --${{ matrix.stability }} --no-interaction
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run Unit Tests
run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage