Skip to content

Commit f69595c

Browse files
authored
Merge pull request #210: Use common github workflows in CI
2 parents a5e3a51 + 8ae2ece commit f69595c

File tree

158 files changed

+5588
-2586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+5588
-2586
lines changed

.gitattributes

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/.github export-ignore
2-
/.editorconfig export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
5-
/tests export-ignore
1+
/.* export-ignore
2+
/tests export-ignore
3+
/*.xml export-ignore
4+
/*.yml export-ignore
5+
/*.lock export-ignore

.github/workflows/ci-mssql.yml

+3-81
Original file line numberDiff line numberDiff line change
@@ -8,88 +8,10 @@ on: # yamllint disable-line rule:truthy
88
- '*.*.*'
99
pull_request: null
1010

11-
name: ci-mssql
11+
name: MSSQL
1212

1313
jobs:
14-
tests:
15-
name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }}
16-
17-
env:
18-
key: cache
19-
20-
runs-on: ubuntu-latest
21-
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
include:
26-
- php: '8.0'
27-
extensions: pdo, pdo_sqlsrv
28-
mssql: 'server:2017-latest'
29-
- php: '8.1'
30-
extensions: pdo, pdo_sqlsrv
31-
mssql: 'server:2019-latest'
32-
odbc-version: 18
33-
flag: "-C"
34-
- php: '8.2'
35-
extensions: pdo, pdo_sqlsrv
36-
mssql: 'server:2019-latest'
37-
odbc-version: 18
38-
flag: "-C"
39-
- php: '8.3'
40-
extensions: pdo, pdo_sqlsrv
41-
mssql: 'server:2019-latest'
42-
odbc-version: 18
43-
flag: "-C"
44-
45-
services:
46-
mssql:
47-
image: mcr.microsoft.com/mssql/${{ matrix.mssql }}
48-
env:
49-
SA_PASSWORD: SSpaSS__1
50-
ACCEPT_EULA: Y
51-
MSSQL_PID: Developer
52-
ports:
53-
- 11433:1433
54-
options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.odbc-version }}/bin/sqlcmd ${{ matrix.flag }} -S localhost -U SA -P 'SSpaSS__1' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=5
55-
56-
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v2
59-
60-
- name: Install PHP with extensions
61-
uses: shivammathur/setup-php@v2
62-
with:
63-
php-version: ${{ matrix.php }}
64-
extensions: ${{ matrix.extensions }}
65-
ini-values: date.timezone='UTC'
66-
tools: composer:v2, pecl
67-
68-
- name: Determine composer cache directory on Linux
69-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
70-
71-
- name: Cache dependencies installed with composer
72-
uses: actions/cache@v2
73-
with:
74-
path: ${{ env.COMPOSER_CACHE_DIR }}
75-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
76-
restore-keys: |
77-
php${{ matrix.php }}-composer-
78-
79-
- name: Update composer
80-
run: composer self-update
81-
82-
- name: Install dependencies with composer
83-
if: matrix.php != '8.3'
84-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
85-
86-
- name: Install dependencies with composer php 8.3
87-
if: matrix.php == '8.3'
88-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
89-
90-
- name: Run tests with phpunit without coverage
91-
env:
92-
DB: sqlserver
93-
run: vendor/bin/phpunit --group driver-sqlserver --colors=always
14+
phpunit:
15+
uses: cycle/gh-actions/.github/workflows/db-mssql.yml@master
9416

9517
...

.github/workflows/ci-mysql.yml

+3-88
Original file line numberDiff line numberDiff line change
@@ -8,95 +8,10 @@ on: # yamllint disable-line rule:truthy
88
- '*.*.*'
99
pull_request: null
1010

11-
name: ci-mysql
11+
name: MySQL
1212

1313
jobs:
14-
tests:
15-
name: PHP ${{ matrix.php-version }}-mysql-${{ matrix.mysql-version }}
16-
env:
17-
extensions: curl, intl, pdo, pdo_mysql
18-
key: cache-v1
19-
20-
runs-on: ${{ matrix.os }}
21-
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
os:
26-
- ubuntu-latest
27-
28-
php-version:
29-
- "8.0"
30-
- "8.1"
31-
- "8.2"
32-
- "8.3"
33-
34-
mysql-version:
35-
- "5.7"
36-
- "8.0"
37-
38-
services:
39-
mysql:
40-
image: mysql:${{ matrix.mysql-version }}
41-
env:
42-
MYSQL_ROOT_PASSWORD: root
43-
MYSQL_DATABASE: spiral
44-
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
45-
ports:
46-
- 13306:3306
47-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
48-
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v2
52-
53-
- name: Setup cache environment
54-
id: cache-env
55-
uses: shivammathur/cache-extensions@v1
56-
with:
57-
php-version: ${{ matrix.php-version }}
58-
extensions: ${{ env.extensions }}
59-
key: ${{ env.key }}
60-
61-
- name: Cache extensions
62-
uses: actions/cache@v2
63-
with:
64-
path: ${{ steps.cache-env.outputs.dir }}
65-
key: ${{ steps.cache-env.outputs.key }}
66-
restore-keys: ${{ steps.cache-env.outputs.key }}
67-
68-
- name: Install PHP with extensions
69-
uses: shivammathur/setup-php@v2
70-
with:
71-
php-version: ${{ matrix.php-version }}
72-
extensions: ${{ env.extensions }}
73-
ini-values: date.timezone='UTC'
74-
coverage: pcov
75-
76-
- name: Determine composer cache directory
77-
if: matrix.os == 'ubuntu-latest'
78-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
79-
80-
- name: Cache dependencies installed with composer
81-
uses: actions/cache@v2
82-
with:
83-
path: ${{ env.COMPOSER_CACHE_DIR }}
84-
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
85-
restore-keys: |
86-
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
87-
88-
- name: Install dependencies with composer
89-
if: matrix.php-version != '8.3'
90-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
91-
92-
- name: Install dependencies with composer php 8.3
93-
if: matrix.php-version == '8.3'
94-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
95-
96-
- name: Run mysql tests with phpunit
97-
env:
98-
DB: mysql
99-
MYSQL: ${{ matrix.mysql-version }}
100-
run: vendor/bin/phpunit --group driver-mysql --colors=always
14+
phpunit:
15+
uses: cycle/gh-actions/.github/workflows/db-mysql.yml@master
10116

10217
...

.github/workflows/ci-pgsql.yml

+3-89
Original file line numberDiff line numberDiff line change
@@ -8,96 +8,10 @@ on: # yamllint disable-line rule:truthy
88
- '*.*.*'
99
pull_request: null
1010

11-
name: ci-pgsql
11+
name: Postgres
1212

1313
jobs:
14-
tests:
15-
name: PHP ${{ matrix.php-version }}-pgsql-${{ matrix.pgsql-version }}
16-
env:
17-
extensions: curl, intl, pdo, pdo_pgsql
18-
key: cache-v1
19-
20-
runs-on: ${{ matrix.os }}
21-
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
os:
26-
- ubuntu-latest
27-
php-version:
28-
- "8.0"
29-
- "8.1"
30-
- "8.2"
31-
- "8.3"
32-
33-
pgsql-version:
34-
- "10"
35-
- "11"
36-
- "12"
37-
- "13"
38-
39-
services:
40-
postgres:
41-
image: postgres:${{ matrix.pgsql-version }}
42-
env:
43-
POSTGRES_USER: postgres
44-
POSTGRES_PASSWORD: postgres
45-
POSTGRES_DB: spiral
46-
ports:
47-
- 15432:5432
48-
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
49-
50-
steps:
51-
- name: Checkout
52-
uses: actions/checkout@v2
53-
54-
- name: Setup cache environment
55-
id: cache-env
56-
uses: shivammathur/cache-extensions@v1
57-
with:
58-
php-version: ${{ matrix.php-version }}
59-
extensions: ${{ env.extensions }}
60-
key: ${{ env.key }}
61-
62-
- name: Cache extensions
63-
uses: actions/cache@v2
64-
with:
65-
path: ${{ steps.cache-env.outputs.dir }}
66-
key: ${{ steps.cache-env.outputs.key }}
67-
restore-keys: ${{ steps.cache-env.outputs.key }}
68-
69-
- name: Install PHP with extensions
70-
uses: shivammathur/setup-php@v2
71-
with:
72-
php-version: ${{ matrix.php-version }}
73-
extensions: ${{ env.extensions }}
74-
ini-values: date.timezone='UTC'
75-
coverage: pcov
76-
77-
- name: Determine composer cache directory
78-
if: matrix.os == 'ubuntu-latest'
79-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
80-
81-
- name: Cache dependencies installed with composer
82-
uses: actions/cache@v2
83-
with:
84-
path: ${{ env.COMPOSER_CACHE_DIR }}
85-
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
86-
restore-keys: |
87-
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
88-
89-
- name: Install dependencies with composer
90-
if: matrix.php-version != '8.3'
91-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
92-
93-
- name: Install dependencies with composer php 8.3
94-
if: matrix.php-version == '8.3'
95-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
96-
97-
- name: Run pgsql tests with phpunit
98-
env:
99-
DB: postgres
100-
POSTGRES: ${{ matrix.pgsql-version }}
101-
run: vendor/bin/phpunit --group driver-postgres --colors=always
14+
phpunit:
15+
uses: cycle/gh-actions/.github/workflows/db-pgsql.yml@master
10216

10317
...

.github/workflows/cs-fix.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
branches:
6+
- '*'
7+
8+
name: Fix Code Style
9+
10+
jobs:
11+
cs-fix:
12+
permissions:
13+
contents: write
14+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
15+
16+
...

.gitignore

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
.idea/
22
.env
3-
.coveralls.yml
4-
vendor/
5-
tests/runtime/*
6-
build/logs/*
7-
build/
3+
/runtime/
4+
/vendor/
5+
/tests/runtime/*
86
*.db
9-
clover.xml
10-
clover.json
11-
.php_cs.cache
12-
.phpunit.result.cache

.php-cs-fixer.dist.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require_once 'vendor/autoload.php';
6+
7+
return \Spiral\CodeStyle\Builder::create()
8+
->include(__DIR__ . '/src')
9+
->include(__FILE__)
10+
->cache('./runtime/php-cs-fixer.cache')
11+
->allowRisky()
12+
->build();

0 commit comments

Comments
 (0)