| 148 |
lars |
1 |
name: "Continuous Integration"
|
|
|
2 |
|
|
|
3 |
on:
|
|
|
4 |
- pull_request
|
|
|
5 |
- push
|
|
|
6 |
|
|
|
7 |
env:
|
|
|
8 |
COMPOSER_ROOT_VERSION: 1.99
|
|
|
9 |
|
|
|
10 |
jobs:
|
|
|
11 |
composer-json-lint:
|
|
|
12 |
name: "Lint composer.json"
|
|
|
13 |
|
|
|
14 |
runs-on: "ubuntu-latest"
|
|
|
15 |
|
|
|
16 |
strategy:
|
|
|
17 |
matrix:
|
|
|
18 |
php-version:
|
|
|
19 |
- "8.1"
|
|
|
20 |
|
|
|
21 |
steps:
|
|
|
22 |
- name: "Checkout"
|
|
|
23 |
uses: "actions/checkout@v2"
|
|
|
24 |
|
|
|
25 |
- name: "Install PHP"
|
|
|
26 |
uses: "shivammathur/setup-php@v2"
|
|
|
27 |
with:
|
|
|
28 |
coverage: "none"
|
|
|
29 |
php-version: "${{ matrix.php-version }}"
|
|
|
30 |
tools: composer-normalize
|
|
|
31 |
|
|
|
32 |
- name: "Get composer cache directory"
|
|
|
33 |
id: composercache
|
|
|
34 |
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
35 |
|
|
|
36 |
- name: "Cache dependencies"
|
|
|
37 |
uses: actions/cache@v2
|
|
|
38 |
with:
|
|
|
39 |
path: ${{ steps.composercache.outputs.dir }}
|
|
|
40 |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
|
|
|
41 |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
|
|
|
42 |
|
|
|
43 |
- name: "Install dependencies"
|
|
|
44 |
run: "composer update --no-interaction --no-progress"
|
|
|
45 |
|
|
|
46 |
- name: "Validate composer.json"
|
|
|
47 |
run: "composer validate --strict"
|
|
|
48 |
|
|
|
49 |
- name: "Normalize composer.json"
|
|
|
50 |
run: "composer-normalize --dry-run"
|
|
|
51 |
|
|
|
52 |
tests:
|
|
|
53 |
name: "Tests"
|
|
|
54 |
|
|
|
55 |
runs-on: "ubuntu-latest"
|
|
|
56 |
|
|
|
57 |
strategy:
|
|
|
58 |
matrix:
|
|
|
59 |
php-version:
|
|
|
60 |
- "7.1"
|
|
|
61 |
- "7.2"
|
|
|
62 |
- "7.3"
|
|
|
63 |
- "7.4"
|
|
|
64 |
- "8.0"
|
|
|
65 |
- "8.1"
|
|
|
66 |
dependencies:
|
|
|
67 |
- "lowest"
|
|
|
68 |
- "highest"
|
|
|
69 |
|
|
|
70 |
steps:
|
|
|
71 |
- name: "Checkout"
|
|
|
72 |
uses: "actions/checkout@v2"
|
|
|
73 |
|
|
|
74 |
- name: "Install PHP"
|
|
|
75 |
uses: "shivammathur/setup-php@v2"
|
|
|
76 |
with:
|
|
|
77 |
php-version: "${{ matrix.php-version }}"
|
|
|
78 |
ini-values: zend.assertions=1
|
|
|
79 |
|
|
|
80 |
- name: "Get composer cache directory"
|
|
|
81 |
id: composercache
|
|
|
82 |
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
83 |
|
|
|
84 |
- name: "Cache dependencies"
|
|
|
85 |
uses: actions/cache@v2
|
|
|
86 |
with:
|
|
|
87 |
path: ${{ steps.composercache.outputs.dir }}
|
|
|
88 |
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
|
|
|
89 |
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
|
|
|
90 |
|
|
|
91 |
- name: "Install lowest dependencies"
|
|
|
92 |
if: ${{ matrix.dependencies == 'lowest' }}
|
|
|
93 |
run: "composer update --no-interaction --no-progress --prefer-lowest"
|
|
|
94 |
|
|
|
95 |
- name: "Install highest dependencies"
|
|
|
96 |
if: ${{ matrix.dependencies == 'highest' }}
|
|
|
97 |
run: "composer update --no-interaction --no-progress"
|
|
|
98 |
|
|
|
99 |
- name: "Run tests"
|
|
|
100 |
timeout-minutes: 3
|
|
|
101 |
run: "vendor/bin/phpunit"
|