Skip to content

Commit 5ff0eb1

Browse files
authored
Merge pull request #555 from FriendsOfCake/admad
CI
2 parents 954f511 + 1e9ae9f commit 5ff0eb1

File tree

5 files changed

+111
-72
lines changed

5 files changed

+111
-72
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Remove files for archives generated using `git archive`
2+
CONTRIBUTING.md export-ignore
3+
.editorconfig export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
phpunit.xml.dist export-ignore
7+
.scrutinizer.yml export-ignore
8+
.stickler.yml export-ignore
9+
tests export-ignore
10+
docs export-ignore
11+
.github export-ignore

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
testsuite:
7+
runs-on: ubuntu-18.04
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
php-version: ['7.2', '7.4']
12+
db-type: [sqlite, mysql, pgsql]
13+
prefer-lowest: ['']
14+
include:
15+
- php-version: '7.2'
16+
db-type: 'sqlite'
17+
prefer-lowest: 'prefer-lowest'
18+
19+
services:
20+
postgres:
21+
image: postgres
22+
ports:
23+
- 5432:5432
24+
env:
25+
POSTGRES_PASSWORD: postgres
26+
27+
steps:
28+
- uses: actions/checkout@v1
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Setup Service
33+
if: matrix.db-type == 'mysql'
34+
run: |
35+
sudo service mysql start
36+
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
37+
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php-version }}
42+
extensions: mbstring, intl, pdo_${{ matrix.db-type }}
43+
coverage: pcov
44+
45+
- name: Composer install
46+
run: |
47+
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
48+
composer update --prefer-lowest --prefer-stable
49+
else
50+
composer install
51+
fi
52+
53+
- name: Run PHPUnit
54+
run: |
55+
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
56+
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi
57+
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi
58+
59+
if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.db-type }} == 'sqlite' ]]; then
60+
vendor/bin/phpunit --coverage-clover=coverage.xml
61+
else
62+
vendor/bin/phpunit
63+
fi
64+
65+
- name: Code Coverage Report
66+
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'sqlite'
67+
uses: codecov/codecov-action@v1
68+
69+
cs-stan:
70+
name: Coding Standard & Static Analysis
71+
runs-on: ubuntu-18.04
72+
73+
steps:
74+
- uses: actions/checkout@v1
75+
with:
76+
fetch-depth: 1
77+
78+
- name: Setup PHP
79+
uses: shivammathur/setup-php@v2
80+
with:
81+
php-version: '7.4'
82+
extension: mbstring, intl
83+
coverage: none
84+
tools: cs2pr, phpstan:^0.12
85+
86+
- name: Composer Install
87+
run: composer install
88+
89+
- name: Run phpcs
90+
run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr
91+
92+
- name: Run phpstan
93+
if: success() || failure()
94+
run: phpstan analyse

.travis.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![Build Status](https://img.shields.io/travis/FriendsOfCake/cakephp-upload/master.svg?style=flat-square)](https://travis-ci.org/FriendsOfCake/cakephp-upload)
2-
[![Coverage Status](https://img.shields.io/coveralls/FriendsOfCake/cakephp-upload.svg?style=flat-square)](https://coveralls.io/r/FriendsOfCake/cakephp-upload?branch=master)
1+
[![Build Status](https://img.shields.io/github/workflow/status/FriendsOfCake/cakephp-upload/CI/master?style=flat-square)](https://github.com/FriendsOfCake/cakephp-upload/actions?query=workflow%3ACI+branch%3Amaster)
2+
[![Coverage Status](https://img.shields.io/codecov/c/github/FriendsOfCake/cakephp-upload.svg?style=flat-square)](https://codecov.io/github/FriendsOfCake/cakephp-upload)
33
[![Total Downloads](https://img.shields.io/packagist/dt/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
44
[![Latest Stable Version](https://img.shields.io/packagist/v/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
55
[![Documentation Status](https://readthedocs.org/projects/cakephp-upload/badge/?version=latest&style=flat-square)](https://readthedocs.org/projects/cakephp-upload/?badge=latest)

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
}
1313
],
1414
"require": {
15-
"cakephp/cakephp": "^4.0.2",
16-
"league/flysystem": "*"
15+
"cakephp/orm": "^4.0.2",
16+
"league/flysystem": "^1.0"
1717
},
1818
"require-dev": {
19+
"cakephp/cakephp": "^4.0.2",
1920
"phpunit/phpunit": "~8.5.0",
2021
"league/flysystem-vfs": "*",
21-
"cakephp/cakephp-codesniffer": "^4.0",
22-
"phpstan/phpstan": "^0.12"
22+
"cakephp/cakephp-codesniffer": "^4.0"
2323
},
2424
"autoload": {
2525
"psr-4": {

0 commit comments

Comments
 (0)