-
Notifications
You must be signed in to change notification settings - Fork 19
88 lines (75 loc) · 2.72 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
name: PHP Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.2, 8.1]
stability: [prefer-lowest, prefer-stable]
laravel: ["11.0", ^9.0, ^10.0]
include:
- laravel: ^10.0
testbench: ^8.0
- laravel: ^9.0
testbench: ^7.0
- laravel: "11.0"
testbench: ^9.0
exclude:
- laravel: "11.0"
php: 8.1
name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.stability }}
steps:
- name: Checkout
uses: actions/checkout@v3
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@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
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 update --${{ matrix.stability }} --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