Skip to content

Commit fe134d2

Browse files
Merge pull request #5 from narendravaghela/master
Fix status and update CI worlflow
2 parents f198e18 + 85841f6 commit fe134d2

5 files changed

Lines changed: 98 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
testsuite-linux:
10+
runs-on: ubuntu-18.04
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php-version: ['7.2', '7.4', '8.0']
15+
prefer-lowest: ['']
16+
include:
17+
- php-version: '7.2'
18+
prefer-lowest: 'prefer-lowest'
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 1
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
extensions: mbstring, intl
30+
coverage: pcov
31+
32+
- name: Get composer cache directory
33+
id: composer-cache
34+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
35+
36+
- name: Get date part for cache key
37+
id: key-date
38+
run: echo "::set-output name=date::$(date +'%Y-%m')"
39+
40+
- name: Cache composer dependencies
41+
uses: actions/cache@v2
42+
with:
43+
path: ${{ steps.composer-cache.outputs.dir }}
44+
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
45+
46+
- name: Composer install
47+
run: |
48+
if [[ ${{ matrix.php-version }} == '8.0' ]]; then
49+
composer install --ignore-platform-reqs
50+
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
51+
composer update --prefer-lowest --prefer-stable
52+
else
53+
composer install
54+
fi
55+
56+
- name: Run PHPUnit
57+
run: |
58+
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
59+
vendor/bin/phpunit --coverage-clover=coverage.xml
60+
else
61+
vendor/bin/phpunit
62+
fi
63+
64+
- name: Code Coverage Report
65+
if: success() && matrix.php-version == '7.4'
66+
uses: codecov/codecov-action@v1
67+
68+
validation:
69+
name: Coding Standard & Static Analysis
70+
runs-on: ubuntu-18.04
71+
72+
steps:
73+
- uses: actions/checkout@v2
74+
with:
75+
fetch-depth: 1
76+
77+
- name: Setup PHP
78+
uses: shivammathur/setup-php@v2
79+
with:
80+
php-version: '7.4'
81+
extensions: mbstring, intl
82+
coverage: none
83+
tools: psalm:~4.1.0
84+
85+
- name: Composer Install
86+
run: composer stan-setup
87+
88+
- name: Run phpstan
89+
run: composer phpstan
90+
91+
- name: Run phpcs
92+
run: composer cs-check
93+
94+
- name: Run psalm
95+
run: psalm --output-format=github

.travis.yml

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

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SendGrid Plugin for CakePHP
22

3-
[![Build Status](https://travis-ci.org/sprintcube/cakephp-sendgrid.svg?branch=master)](https://travis-ci.org/sprintcube/cakephp-sendgrid)
43
[![codecov](https://codecov.io/gh/sprintcube/cakephp-sendgrid/branch/master/graph/badge.svg)](https://codecov.io/gh/sprintcube/cakephp-sendgrid)
54
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
65
[![Latest Stable Version](https://poser.pugx.org/sprintcube/cakephp-sendgrid/v/stable)](https://packagist.org/packages/sprintcube/cakephp-sendgrid)

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
],
5757
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
5858
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
59+
"psalm": "psalm",
60+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 vimeo/psalm:~4.1.0 && mv composer.backup composer.json",
5961
"phpstan": "phpstan analyze --level 1 src/",
6062
"test": "phpunit --colors=always"
6163
},

src/Mailer/Transport/SendGridTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ protected function _sendEmail()
268268
$result = [];
269269
$result['apiResponse'] = $response->getJson();
270270
$result['responseCode'] = $response->getStatusCode();
271-
$result['staus'] = $result['responseCode'] == 202 ? 'OK' : 'ERROR';
271+
$result['status'] = $result['responseCode'] == 202 ? 'OK' : 'ERROR';
272272
if (Configure::read('debug')) {
273273
$result['reqParams'] = $this->_reqParams;
274274
}

0 commit comments

Comments
 (0)