-
Notifications
You must be signed in to change notification settings - Fork 117
119 lines (99 loc) · 3.73 KB
/
main.yml
File metadata and controls
119 lines (99 loc) · 3.73 KB
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
name: PHP CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
merge_group:
workflow_dispatch: {}
permissions:
contents: read
jobs:
php-test:
name: PHP Test
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '7.3', '8.2', '8.4' ]
include:
- php-version: '8.2'
validate: true
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Validate composer.json and composer.lock
if: matrix.validate
run: composer validate --strict
- name: Check PHP syntax
if: matrix.validate
run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit tests
run: vendor/bin/phpunit --testsuite=unit --coverage-clover build/clover.xml --log-junit build/tests-log.xml
- name: Clean up reports
run: sed -i "s;`pwd`/;;g" build/*.xml
php-lint:
name: PHP Lint
needs: php-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
php-version: '8.2'
tools: composer:v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs --exclude=Generic.Files.LineLength
integration-tests:
name: Integration Tests
needs: [php-test, php-lint]
runs-on: ubuntu-latest
# Only run integration tests on pull requests with release label and from the main repository
if: |
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'release') &&
github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
php-version: '8.2'
tools: composer:v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run integration tests
run: vendor/bin/phpunit --testsuite=integration --no-coverage
env:
INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }}
INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }}
INTEGRATION_X_API_KEY: ${{ secrets.INTEGRATION_X_API_KEY }}
INTEGRATION_MERCHANT_ACCOUNT: ${{ secrets.INTEGRATION_MERCHANT_ACCOUNT }}
INTEGRATION_DONATION_ACCOUNT: ${{ secrets.INTEGRATION_DONATION_ACCOUNT }}
INTEGRATION_SKIN_CODE: ${{ secrets.INTEGRATION_SKIN_CODE }}
INTEGRATION_HMAC_SIGNATURE: ${{ secrets.INTEGRATION_HMAC_SIGNATURE }}
INTEGRATION_STORE_PAYOUT_USERNAME: ${{ secrets.INTEGRATION_STORE_PAYOUT_USERNAME }}
INTEGRATION_STORE_PAYOUT_PASSWORD: ${{ secrets.INTEGRATION_STORE_PAYOUT_PASSWORD }}
INTEGRATION_REVIEW_PAYOUT_USERNAME: ${{ secrets.INTEGRATION_REVIEW_PAYOUT_USERNAME }}
INTEGRATION_REVIEW_PAYOUT_PASSWORD: ${{ secrets.INTEGRATION_REVIEW_PAYOUT_PASSWORD }}