From 97d8ecccec2927cd3324d3ed26a1808fab9a812b Mon Sep 17 00:00:00 2001 From: derberg Date: Thu, 10 Dec 2020 18:03:15 +0100 Subject: [PATCH 1/2] ci: add PR testing workflow and improve npm scripts --- .github/workflows/pull-request-testing.yml | 24 ++++++++++++++++++++++ .gitignore | 2 +- package.json | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pull-request-testing.yml diff --git a/.github/workflows/pull-request-testing.yml b/.github/workflows/pull-request-testing.yml new file mode 100644 index 000000000..fd0be68cb --- /dev/null +++ b/.github/workflows/pull-request-testing.yml @@ -0,0 +1,24 @@ +name: Pull request testing + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + +jobs: + test_pr: + if: github.event.pull_request.draft == false + name: 'Testing pull request' + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 14 + - name: Install dependencies + run: npm ci + - name: Run linter + run: npm run lint + - name: Run tests + run: npm test diff --git a/.gitignore b/.gitignore index 82978cc68..c7648ae57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ - +coverage node_modules .DS_Store output diff --git a/package.json b/package.json index 4f35b8756..20bbe76d4 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "scripts": { "release": "semantic-release", "get-version": "echo $npm_package_version", - "eslint": "eslint --config .eslintrc lib", + "lint": "eslint --max-warnings 0 --config .eslintrc lib", "package": "npm run test && ncc build lib/index.js -o dist", - "test": "npm run eslint && jest", + "test": "npm run lint && jest --coverage", "start": "node lib/index.js" }, "repository": { From 37dc555912aa8f773b4e4ebd1d8aa1830261486e Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Thu, 10 Dec 2020 18:29:55 +0100 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 20bbe76d4..2bb88c096 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "get-version": "echo $npm_package_version", "lint": "eslint --max-warnings 0 --config .eslintrc lib", "package": "npm run test && ncc build lib/index.js -o dist", - "test": "npm run lint && jest --coverage", + "test": "jest --coverage", "start": "node lib/index.js" }, "repository": {