-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 2.08 KB
/
continuous-integration.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
# GitHub Actions workflow for Continuos Integration tests
name: "Continuous Integration"
on: [push, pull_request]
env:
COMPOSER_ARGS: '--no-interaction --no-progress --prefer-dist --optimize-autoloader'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
operating-systems: [ubuntu-latest]
php-versions: ['8.0', '8.1', '8.2']
composer-deps: ['lowest', 'latest']
runs-on: ${{ matrix.operating-systems }}
steps:
- name: Checkout the repository
id: repo-checkout
uses: actions/checkout@v3
# Docs: https://github.com/shivammathur/setup-php
- name: Setup PHP
id: php-setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
- name: Validate composer.json and composer.lock
id: composer-validate
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install Composer dependencies
id: composer-install
run: composer install ${{ env.COMPOSER_ARGS }}
- name: Update Composer dependencies to lowest stable
id: composer-update-lowest
if: ${{ matrix.composer-deps == 'lowest' }}
run: composer update ${{ env.COMPOSER_ARGS }} --prefer-lowest --prefer-stable
- name: Update Composer dependencies to latest
id: composer-update-latest
if: ${{ matrix.composer-deps == 'latest' }}
run: composer update ${{ env.COMPOSER_ARGS }}
- name: Code Style check (phpcs)
id: phpcs
run: composer phpcs
- name: Static Analysis (phpstan)
id: phpstan
run: composer phpstan
- name: Test (phpunit)
id: phpunit
run: composer test
- name: Coverage (clover)
id: coverage-clover
run: composer test-coverage