-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (74 loc) · 3.21 KB
/
Copy pathci.yml
File metadata and controls
91 lines (74 loc) · 3.21 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
name: CI
on:
push:
branches: [ 6.0 ]
pull_request:
branches: [ 6.0 ]
permissions:
contents: read
env:
XDEBUG_MODE: coverage
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-versions: '8.4'
composer-prefer: ''
symfony-require: ''
- php-versions: '8.4'
composer-prefer: '--prefer-lowest'
symfony-require: '6.4.*'
steps:
- uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: sqlite3, pdo_sqlite
coverage: xdebug
ini-values: "post_max_size=256M" #optional
- name: Check PHP Version
run: php -v
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Get Composer cache directory
id: composer-cache-dir
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v5
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.composer-prefer }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-
- name: Install dependencies
run: |
if [ -n "${{ matrix.symfony-require }}" ]; then
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require symfony/flex:^2.8 --prefer-dist --no-interaction --no-progress --prefer-stable
export SYMFONY_REQUIRE="${{ matrix.symfony-require }}"
fi
COMPOSER_ROOT_VERSION=6.0.x-dev composer update --prefer-dist --no-interaction --no-progress --prefer-stable ${{ matrix.composer-prefer }}
- name: Run phpstan
run: ./vendor/bin/phpstan analyse
- name: Run tests
run: ./vendor/bin/phpunit
- name: Code Style check
run: ./vendor/bin/php-cs-fixer fix -v --diff --dry-run
- name: Check coverage report
id: coverage_report
run: |
if [ -f clover.xml ]; then
echo "has_clover=true" >> "$GITHUB_OUTPUT"
else
echo "has_clover=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload coverage to Codecov
if: matrix.composer-prefer == '' && steps.coverage_report.outputs.has_clover == 'true'
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: clover.xml