forked from sebdesign/laravel-viva-payments
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.87 KB
/
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
name: PHP Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.4, 8.3, 8.2, 8.1]
laravel: [11.*, 10.*, 9.*]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
exclude:
- laravel: 11.*
php: 8.1
- laravel: 10.*
php: 8.4
- laravel: 9.*
php: 8.4
- laravel: 9.*
php: 8.3
name: Tests P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.php }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: pcov
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-stable --no-interaction --prefer-dist
- name: Execute tests
env:
VIVA_API_KEY: ${{ secrets.VIVA_API_KEY }}
VIVA_CLIENT_ID: ${{ secrets.VIVA_CLIENT_ID }}
VIVA_CLIENT_SECRET: ${{ secrets.VIVA_CLIENT_SECRET }}
VIVA_ISV_CLIENT_ID: ${{ secrets.VIVA_ISV_CLIENT_ID }}
VIVA_ISV_CLIENT_SECRET: ${{ secrets.VIVA_ISV_CLIENT_SECRET }}
VIVA_ISV_PARTNER_API_KEY: ${{ secrets.VIVA_ISV_PARTNER_API_KEY }}
VIVA_ISV_PARTNER_ID: ${{ secrets.VIVA_ISV_PARTNER_ID }}
VIVA_ENVIRONMENT: demo
VIVA_MERCHANT_ID: ${{ secrets.VIVA_MERCHANT_ID }}
VIVA_SOURCE_CODE: ${{ secrets.VIVA_SOURCE_CODE }}
run: vendor/bin/phpunit --coverage-clover=build/coverage/coverage.clover
- name: Upload coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/coverage/coverage.clover"