-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (64 loc) · 2.6 KB
/
ci.yaml
File metadata and controls
79 lines (64 loc) · 2.6 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
name: CI
on: push
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
php: [8.0, 8.1, 8.2, 8.3]
prefer-lowest: [false, true]
runs-on: ${{ matrix.os }}
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pcov
- uses: actions/checkout@v4
- name: Get Composer cache directory path
id: composer-cache-dir-path
run: echo "path=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir-path.outputs.path }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
- name: Install Composer dependencies
if: ${{ !matrix.prefer-lowest }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Install lowest Composer dependencies
if: ${{ matrix.prefer-lowest }}
run: |
composer update --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --prefer-lowest
composer update --dev --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Install composer-bin-plugin dependencies
if: ${{ matrix.php == '8.3' && !matrix.prefer-lowest }}
run: composer bin all install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Execute tests in latest environment
if: ${{ matrix.php == '8.3' && !matrix.prefer-lowest }}
run: composer tests
- name: Execute tests for backward compatibility
if: ${{ matrix.php != '8.3' || matrix.prefer-lowest }}
run: composer tests:bc
- name: Generate coverage report
if: ${{ matrix.php == '8.3' && !matrix.prefer-lowest }}
run: composer pcov
- name: Upload coverage report to Codecov
if: ${{ matrix.php == '8.3' && !matrix.prefer-lowest }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage.xml
verbose: true
deploy-demo:
if: ${{ github.ref == 'refs/heads/main' }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ttskchpaginatorbundle
heroku_email: ${{ secrets.HEROKU_EMAIL }}
appdir: demo