-
-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (66 loc) · 2.44 KB
/
ci_build.yml
File metadata and controls
70 lines (66 loc) · 2.44 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
name: "ci build"
on:
pull_request:
push:
branches:
- "master"
jobs:
build:
name: PHP ${{ matrix.php-versions }} (${{ matrix.dependency-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.3', '8.4', '8.5']
dependency-versions: ['lowest', 'latest']
steps:
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
extensions: intl
php-version: "${{ matrix.php-versions }}"
coverage: ${{ matrix.php-versions == '8.4' && 'xdebug' || 'none' }}
- name: Setup MySQL
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
- run: mysql -uroot -h127.0.0.1 -e 'SELECT version()'
- name: Checkout
uses: actions/checkout@v4
- name: Import DB
run: "mysql -u root -h 127.0.0.1 -e 'create database errorheromodule' && mysql -u root -h 127.0.0.1 errorheromodule < spec/Fixture/data/sql.sql"
- name: "Validate composer.json"
run: "composer validate"
- name: "Install dependencies (${{ matrix.dependency-versions }})"
run: |
if [ "${{ matrix.dependency-versions }}" = "lowest" ]; then
composer update --prefer-lowest --prefer-stable --no-interaction --no-progress --ignore-platform-reqs
else
composer update --no-interaction --no-progress --ignore-platform-reqs
fi
- name: "CS Check"
run: "composer cs-check"
- name: "Code analyze"
run: |
composer phpstan
bin/rector process --dry-run
- name: "Run test suite (no coverage)"
if: matrix.php-versions != '8.4' || matrix.dependency-versions != 'latest'
run: |
composer dump-autoload -o
bin/kahlan
- name: "Run test suite (with coverage)"
if: matrix.php-versions == '8.4' && matrix.dependency-versions == 'latest'
run: |
composer dump-autoload -o
mkdir -p build/logs && bin/kahlan --coverage=4 --reporter=verbose --clover=build/logs/clover.xml
- name: Upload coverage to Codecov
if: matrix.php-versions == '8.4' && matrix.dependency-versions == 'latest'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/logs/clover.xml
flags: tests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true