-
Notifications
You must be signed in to change notification settings - Fork 103
60 lines (48 loc) · 2.34 KB
/
main.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
name: Main Workflow
on: ["pull_request"]
jobs:
run:
name: Run
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.3, 8.2 ]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Checkout
uses: actions/checkout@v4
with:
# Disabling shallow clone to improve relevancy of SonarCloud reporting
fetch-depth: 0
- name: Validate composer.json and composer.lock
run: composer validate --strict
- 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 }}
- name: Run unit tests
run: vendor/bin/phpunit --testsuite=unit --coverage-clover build/clover.xml --log-junit build/tests-log.xml
# PHPUnit generates absolute file paths and SonarCloud expects relative file paths. This command removes the
# current working directory from the report files.
- name: Clean up reports
run: sed -i "s;`pwd`/;;g" build/*.xml
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs --exclude=Generic.Files.LineLength
- name: Make sure project files are compilable
run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l