-
Notifications
You must be signed in to change notification settings - Fork 5
117 lines (111 loc) · 4.22 KB
/
php.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: liquetsoft_fias
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Liquetsoft FIAS (PHP ${{ matrix.php-versions }}, Laravel ${{ matrix.laravel-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php-versions: ['8.2', '8.3']
laravel-versions: ['^8.0', '^9.0', '^10.0', '^11.0']
steps:
- uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Check PHP Version
run: php -v
- name: Validate composer.json
run: composer validate
- name: Set up Laravel components versions
run: "sed -i -E \"s#\\\"(laravel/.+)\\\".*:.*\\\"(.+)\\\"#\\\"\\1\\\":\\\"${{ matrix.laravel-versions }}\\\"#g\" composer.json"
- name: Set up Illuminate components versions
run: "sed -i -E \"s#\\\"(illuminate/.+)\\\".*:.*\\\"(.+)\\\"#\\\"\\1\\\":\\\"${{ matrix.laravel-versions }}\\\"#g\" composer.json"
- name: Show composer.json
run: cat composer.json
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-laravel-${{ matrix.laravel-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run test suite
run: composer run-script test
- name: Run linters
run: composer run-script linter
laravel:
name: Testing installation to laravel (PHP ${{ matrix.php-version }}, Laravel ${{ matrix.laravel-version }})
runs-on: ubuntu-latest
env:
DB_DATABASE: laravel
DB_USERNAME: root
DB_PASSWORD: password
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: laravel
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3']
laravel-version: ['^8.0', '^9.0', '^10.0', '^11.0']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, dom, fileinfo, mysql, curl
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Branch used
id: extract_branch
run: |
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})"
elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
echo "::set-output name=branch::$(echo $GITHUB_HEAD_REF)"
else
echo "::set-output name=branch::INVALID_EVENT_BRANCH_UNKNOWN"
fi
- name: Install Laravel
run: |
composer create-project laravel/laravel example-app ${{ matrix.laravel-version }}
unzip ./tests/Pipeline/_fixtures/install_AddressObject.zip -d ./example-app/fias-data-install
unzip ./tests/Pipeline/_fixtures/update_AddressObject.zip -d ./example-app/fias-data-update
- name: Install FIAS
run: |
cd example-app
composer req "liquetsoft/fias-laravel:dev-${{ steps.extract_branch.outputs.branch }}" -W
php artisan config:clear
php artisan migrate -v
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- name: Test FIAS
run: |
cd example-app
php artisan liquetsoft:fias:truncate
php artisan liquetsoft:fias:install_from_folder ./fias-data-install
php artisan liquetsoft:fias:update_from_folder ./fias-data-update
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}