10000 ci: Run PHPUnit tests on push · grok-php/laravel@f362eee · GitHub
[go: up one dir, main page]

Skip to content

Commit f362eee

Browse files
committed
ci: Run PHPUnit tests on push
1 parent d47b60b commit f362eee

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/run-tests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: run-tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
paths:
9+
- '**.php'
10+
- '.github/workflows/run-tests.yml'
11+
- 'phpunit.xml.dist'
12+
- 'composer.json'
13+
- 'composer.lock'
14+
15+
jobs:
16+
test:
17+
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 10
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
php: [8.3, 8.4]
24+
stability: [prefer-lowest, prefer-stable]
25+
26+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Laravel Tests
27+
28+
steps:
29+
- name: Checkout Code
30+
uses: actions/checkout@v4
31+
32+
- name: Setup PHP ${{ matrix.php }}
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
37+
coverage: none
38+
39+
- name: Install Dependencies (${{ matrix.stability }})
40+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
41+
42+
- name: Configure PHPUnit
43+
run: |
44+
cp phpunit.xml.dist phpunit.xml
45+
sed -i 's|<env name="GROK_API_KEY" value=""/>|<env name="GROK_API_KEY" value="${{ secrets.GROK_API_KEY }}"/>|g' phpunit.xml
46+
47+
- name: Cache Dependencies
48+
uses: actions/cache@v3
49+
with:
50+
path: vendor
51+
key: composer-${{ matrix.php }}-${{ matrix.stability }}-${{ hashFiles('composer.lock') }}
52+
restore-keys: |
53+
composer-${{ matrix.php }}-${{ matrix.stability }}-
54+
55+
- name: List Installed Dependencies
56+
run: composer show -D
57+
58+
- name: Run PHPUnit Tests
59+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)
0