Skip to content

chore: configure CI in Github actions #808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .circleci/config.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node CI

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: npm install, test
run: |
npm install
npm test
env:
CI: true
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

26 changes: 17 additions & 9 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@ const ENABLE_COVERAGE = !!process.env.CI || !!process.env.COVERAGE;
module.exports = {
collectCoverage: ENABLE_COVERAGE,
coverageDirectory: "coverage/",
coverageThreshold: {
global: {
statements: 95.6,
branches: 89.6,
functions: 99,
lines: 96.1,
},
},
projects: [
{
displayName: "test",
testEnvironment: "node",
},
//{
// runner: "jest-runner-eslint",
// displayName: "lint",
// testMatch: ["<rootDir>/**/*.js"],
// testPathIgnorePatterns: [
// "<rootDir>/node_modules/",
// "<rootDir>/coverage/",
// ],
//},
{
runner: "jest-runner-eslint",
displayName: "lint",
testMatch: ["<rootDir>/**/*.js"],
testPathIgnorePatterns: [
"<rootDir>/node_modules/",
"<rootDir>/coverage/",
],
},
],
};
2 changes: 1 addition & 1 deletion src/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ AST.prototype.prepare = function (kind, docs, parser) {
AST.prototype.checkNodes = function () {
const errors = [];
for (const k in AST.stack) {
if (AST.stack.hasOwnProperty(k)) {
if (Object.prototype.hasOwnProperty.call(AST.stack, k)) {
errors.push(AST.stack[k]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Engine.prototype.tokenGetAll = function (buffer) {
const result = [];
while (token != EOF) {
let entry = this.lexer.yytext;
if (names.hasOwnProperty(token)) {
if (Object.prototype.hasOwnProperty.call(names, token)) {
entry = [names[token], entry, this.lexer.yylloc.first_line];
}
result.push(entry);
Expand Down
9 changes: 7 additions & 2 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,12 @@ Parser.prototype.lex = function () {
this.token = this.lexer.lex() || this.EOF;
if (this.token === this.EOF) return this;
let entry = this.lexer.yytext;
if (this.lexer.engine.tokens.values.hasOwnProperty(this.token)) {
if (
Object.prototype.hasOwnProperty.call(
this.lexer.engine.tokens.values,
this.token
)
) {
entry = [
this.lexer.engine.tokens.values[this.token],
entry,
Expand Down Expand Up @@ -686,7 +691,7 @@ Parser.prototype.is = function (type) {
require("./parser/variable.js"),
].forEach(function (ext) {
for (const k in ext) {
if (Parser.prototype.hasOwnProperty(k)) {
if (Object.prototype.hasOwnProperty.call(Parser.prototype, k)) {
// @see https://github.com/glayzzle/php-parser/issues/234
throw new Error("Function " + k + " is already defined - collision");
}
Expand Down