-
Notifications
You must be signed in to change notification settings - Fork 20
59 lines (51 loc) · 1.86 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
name: Run Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request_target:
types: [labeled]
branches: [main]
jobs:
test:
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main')
strategy:
max-parallel: 1
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
laravel: [8.*, 9.*, 10.*, 11.*]
exclude:
- php: 7.4
laravel: 9.*
- php: 8.2
laravel: 8.*
- php: 8.2
laravel: 9.*
services:
stripemock:
image: stripe/stripe-mock:v0.141.0
ports:
- 12111
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: posix, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
- name: Install dependencies
run: |
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}"
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress --no-suggest
- name: Copy .env.example to .env
run: cp .env.testing.example .env.testing
- name: Run PHP tests
run: vendor/bin/phpunit
env:
STRIPE_TEST_SECRET: "${{ secrets.STRIPE_SECRET }}"
STRIPE_API_BASE: "127.0.0.1:${{ job.services.stripemock.ports[12111] }}"