forked from llaville/php-compatinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (105 loc) · 4.35 KB
/
php-tests.yaml
File metadata and controls
123 lines (105 loc) · 4.35 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
120
121
122
123
name: Tests
on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
paths-ignore:
- 'docs/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
lint_files:
name: Lint Code Base
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php:
- 7.4
steps:
- # Git Checkout
name: Checkout Code
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0
- # Setup PHP runtime
name: Setup PHP runtime
uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php }}
- # Install Composer dependencies
name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
with:
composer-options: "--prefer-dist"
- # Mega-Linter
name: Mega-Linter
id: ml
# You can override Mega-Linter flavor used to have faster performances
# More info at https://megalinter.github.io/latest/flavors/
uses: megalinter/megalinter/flavors/php@v5
env:
# All available variables are described in documentation
# https://megalinter.github.io/latest/configuration/
# Validates all source when push on master, else just the git diff with master. Override with true if you always want to lint all sources
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
LOG_LEVEL: INFO
TEXT_REPORTER: false
php_tests:
needs: lint_files
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
-
os: ubuntu-latest
php: 7.4
extensions: json,pcre,pdo,phar,spl,mbstring,sqlite
tools: phpstan,phpunit
-
os: ubuntu-latest
php: 8.0
extensions: json,pcre,pdo,phar,spl,mbstring,sqlite
tools: phpstan,phpunit
-
os: ubuntu-latest
php: 8.1
extensions: json,pcre,pdo,phar,spl,mbstring,sqlite
tools: phpstan,phpunit
name: Compatibility Info
steps:
- # Git Checkout
name: Checkout
uses: actions/checkout@v2
- # Setup PHP runtime
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
tools: ${{ matrix.tools }}
- # Install Composer dependencies
name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
with:
composer-options: "--prefer-dist"
- # Build Database
name: Build Database
run: |
vendor/bin/doctrine orm:schema-tool:create --ansi
vendor/bartlett/php-compatinfo-db/bin/compatinfo-db db:init --ansi
- # Run unit tests
name: Unit tests
run: phpunit --group features,large,reference,regression,default