Skip to content
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

ci: add pr testing workflow and improve npm scripts #18

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions .github/workflows/pull-request-testing.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

coverage
node_modules
.DS_Store
output
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
derberg marked this conversation as resolved.
Show resolved Hide resolved
"start": "node lib/index.js"
},
"repository": {
Expand Down