Skip to content

Commit 966a6c2

Browse files
authored
Merge pull request glayzzle#808 from czosel/github-actions
chore: configure CI in Github actions
2 parents 1f55eb7 + a24356f commit 966a6c2

File tree

7 files changed

+52
-59
lines changed

7 files changed

+52
-59
lines changed

.circleci/config.yml

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

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Node CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
node-version: [12.x, 14.x, 16.x]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: npm install, test
22+
run: |
23+
npm install
24+
npm test
25+
env:
26+
CI: true

.travis.yml

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

jest.config.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@ const ENABLE_COVERAGE = !!process.env.CI || !!process.env.COVERAGE;
55
module.exports = {
66
collectCoverage: ENABLE_COVERAGE,
77
coverageDirectory: "coverage/",
8+
coverageThreshold: {
9+
global: {
10+
statements: 95.6,
11+
branches: 89.6,
12+
functions: 99,
13+
lines: 96.1,
14+
},
15+
},
816
projects: [
917
{
1018
displayName: "test",
1119
testEnvironment: "node",
1220
},
13-
//{
14-
// runner: "jest-runner-eslint",
15-
// displayName: "lint",
16-
// testMatch: ["<rootDir>/**/*.js"],
17-
// testPathIgnorePatterns: [
18-
// "<rootDir>/node_modules/",
19-
// "<rootDir>/coverage/",
20-
// ],
21-
//},
21+
{
22+
runner: "jest-runner-eslint",
23+
displayName: "lint",
24+
testMatch: ["<rootDir>/**/*.js"],
25+
testPathIgnorePatterns: [
26+
"<rootDir>/node_modules/",
27+
"<rootDir>/coverage/",
28+
],
29+
},
2230
],
2331
};

src/ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ AST.prototype.prepare = function (kind, docs, parser) {
475475
AST.prototype.checkNodes = function () {
476476
const errors = [];
477477
for (const k in AST.stack) {
478-
if (AST.stack.hasOwnProperty(k)) {
478+
if (Object.prototype.hasOwnProperty.call(AST.stack, k)) {
479479
errors.push(AST.stack[k]);
480480
}
481481
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Engine.prototype.tokenGetAll = function (buffer) {
213213
const result = [];
214214
while (token != EOF) {
215215
let entry = this.lexer.yytext;
216-
if (names.hasOwnProperty(token)) {
216+
if (Object.prototype.hasOwnProperty.call(names, token)) {
217217
entry = [names[token], entry, this.lexer.yylloc.first_line];
218218
}
219219
result.push(entry);

src/parser.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,12 @@ Parser.prototype.lex = function () {
615615
this.token = this.lexer.lex() || this.EOF;
616616
if (this.token === this.EOF) return this;
617617
let entry = this.lexer.yytext;
618-
if (this.lexer.engine.tokens.values.hasOwnProperty(this.token)) {
618+
if (
619+
Object.prototype.hasOwnProperty.call(
620+
this.lexer.engine.tokens.values,
621+
this.token
622+
)
623+
) {
619624
entry = [
620625
this.lexer.engine.tokens.values[this.token],
621626
entry,
@@ -686,7 +691,7 @@ Parser.prototype.is = function (type) {
686691
require("./parser/variable.js"),
687692
].forEach(function (ext) {
688693
for (const k in ext) {
689-
if (Parser.prototype.hasOwnProperty(k)) {
694+
if (Object.prototype.hasOwnProperty.call(Parser.prototype, k)) {
690695
// @see https://github.com/glayzzle/php-parser/issues/234
691696
throw new Error("Function " + k + " is already defined - collision");
692697
}

0 commit comments

Comments
 (0)