-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (64 loc) · 2.6 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# GitHub Actions Documentation: https://docs.github.com/en/actions
name: build
on: [push, pull_request]
jobs:
tests:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ['8.0', '8.1', '8.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Set git to use LF on Windows
if: matrix.operating-system == 'windows-latest'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, ctype, iconv, curl, fileinfo
coverage: xdebug
tools: composer:v2
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --optimize-autoloader
- name: Run unit tests (PHPUnit)
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
- name: "Upload coverage report to Codecov"
uses: codecov/codecov-action@v2
continue-on-error: true
with:
files: ./coverage.xml
- name: "Upload coverage report to CodeClimate"
uses: paambaati/[email protected]
continue-on-error: true
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Check coding standards (PHP_CodeSniffer)
run: vendor/bin/phpcs
#- name: Statically analyze code (Phpstan)
# run: vendor/bin/phpstan analyse
#- name: Statically analyze code (Psalm)
# run: vendor/bin/psalm --output-format=github --taint-analysis --shepherd --report=build/logs/psalm.sarif
#- name: "Upload security analysis results to GitHub"
# uses: "github/codeql-action/upload-sarif@v1"
# with:
# sarif_file: "build/logs/psalm.sarif"
- name: "Benchmark for Performance"
if: matrix.operating-system == 'windows-latest'
run: |
composer require phpbench/phpbench -W
vendor/bin/phpbench run --report=default --revs=1000 -l none