Skip to content

Commit c265fba

Browse files
authored
Remove .travis.yml and update codecov (swoole#4191)
1 parent ca775ae commit c265fba

File tree

3 files changed

+22
-76
lines changed

3 files changed

+22
-76
lines changed

.github/workflows/lib.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: lib-swoole
33
on: [push, pull_request]
44

55
env:
6-
CODECOV_TOKEN: "50513381-198e-43d3-a8b1-e36b95038927" # from: https://codecov.io/gh/swoole/swoole-src
6+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
77

88
jobs:
99
build:
@@ -41,6 +41,11 @@ jobs:
4141
run: sudo apt-get install lcov &&
4242
sudo lcov --directory . --capture --output-file coverage.info &&
4343
sudo lcov --remove coverage.info "${{runner.workspace}}/swoole-src/include/*" '/usr/*' --output-file coverage.info &&
44-
sudo lcov --list coverage.info &&
45-
sudo curl -s https://codecov.io/bash -o codecov.sh &&
46-
sudo chmod +x codecov.sh && sudo ./codecov.sh -f coverage.info -t ${CODECOV_TOKEN}
44+
sudo lcov --list coverage.info
45+
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v1
48+
with:
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
files: ./coverage.info
51+
fail_ci_if_error: true

.travis.yml

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

ext-src/php_swoole_library.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Generated by build-library.php, Please DO NOT modify!
33
*/
44

5-
/* $Id: c1d47051d7a949c0a76ca595f6d523faa2ecc3b9 */
5+
/* $Id: b2d3486c3bca310c730de8575e71b27d2d0ee30d */
66

77
static const char* swoole_library_source_constants =
88
"\n"
@@ -2803,9 +2803,14 @@ static const char* swoole_library_source_core_database_pdo_proxy =
28032803
" || $n === 0\n"
28042804
" || $this->__object->inTransaction()\n"
28052805
" ) {\n"
2806-
" $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n"
2807-
" $exception->errorInfo = $errorInfo;\n"
2808-
" throw $exception;\n"
2806+
" /* '00000' means “no error.”, as specified by ANSI SQL and ODBC. */\n"
2807+
" if (!empty($errorInfo) && $errorInfo[0] !== '00000') {\n"
2808+
" $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n"
2809+
" $exception->errorInfo = $errorInfo;\n"
2810+
" throw $exception;\n"
2811+
" }\n"
2812+
" /* no error info, just return false */\n"
2813+
" break;\n"
28092814
" }\n"
28102815
" $this->reconnect();\n"
28112816
" continue;\n"
@@ -2917,12 +2922,14 @@ static const char* swoole_library_source_core_database_pdo_statement_proxy =
29172922
" ) {\n"
29182923
" $errorInfo = $this->__object->errorInfo();\n"
29192924
"\n"
2920-
" // '00000' means “no error.”, as specified by ANSI SQL and ODBC.\n"
2921-
" if ($errorInfo[0] !== '00000') {\n"
2925+
" /* '00000' means “no error.”, as specified by ANSI SQL and ODBC. */\n"
2926+
" if (!empty($errorInfo) && $errorInfo[0] !== '00000') {\n"
29222927
" $exception = new PDOException($errorInfo[2], $errorInfo[1]);\n"
29232928
" $exception->errorInfo = $errorInfo;\n"
29242929
" throw $exception;\n"
29252930
" }\n"
2931+
" /* no error info, just return false */\n"
2932+
" break;\n"
29262933
" }\n"
29272934
" if ($this->parent->getRound() === $this->parentRound) {\n"
29282935
" /* if not equal, parent has reconnected */\n"

0 commit comments

Comments
 (0)