Skip to content

Commit

Permalink
ci: run tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
martinm82 committed Jan 5, 2023
1 parent 15518fe commit fd8261d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
name: Node.js CI
"on":

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
if: ${{ github.actor != 'dependabot'}}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
test: ['lint', 'citest']
node_version: ['12.x', '16.x']
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 12.x
node-version: ${{ matrix.node_version }}
cache: 'npm'
- run: npm install

- run: npm run ${{ matrix.test }}

31 changes: 25 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
"scripts": {
"dev": "nodemon --inspect",
"start": "probot run ./index.js",
"test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
"lint:es": "eslint .",
"test": "npm-run-all --print-label --parallel test:*",
"citest": "npm-run-all --print-label --parallel \"test:* -- --reporters=github-actions\"",
"testall": "npm-run-all --print-label --parallel lint:* --parallel test:*",
"lint": "npm-run-all --print-label --parallel lint:*",
"lint:es": "eslint --format github --format junit .",
"lint:js": "standard",
"lint:lockfile": "lockfile-lint --path package-lock.json --type npm --validate-https --allowed-hosts npm",
"lint:engines": "check-engine",
Expand All @@ -24,16 +27,18 @@
"dependencies": {
"@probot/adapter-aws-lambda-serverless": "^3.0.1",
"deepmerge": "^4.2.2",
"eslint-formatter-github": "^1.0.11",
"eta": "^1.12.3",
"jest-junit": "^15.0.0",
"js-yaml": "^4.1.0",
"node-cron": "^3.0.2",
"probot": "^12.2.8"
},
"devDependencies": {
"@eslint/eslintrc": "^1.3.1",
"@travi/any": "^2.1.5",
"check-engine": "^1.10.1",
"eslint": "^8.23.0",
"@eslint/eslintrc": "^1.3.1",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
Expand All @@ -56,14 +61,28 @@
"engines": {
"node": ">= 12.14.1"
},
"jest": {
"testEnvironment": "node"
},
"nodemonConfig": {
"exec": "npm start",
"watch": [
".env",
"."
]
},
"jest": {
"testEnvironment": "node",
"reporters": [
"default",
"jest-junit"
]
},
"jest-junit": {
"suiteName": "jest tests",
"outputDirectory": "reports",
"outputName": "jest-junit.xml",
"uniqueOutputName": "false",
"classNameTemplate": "{classname}-{title}",
"titleTemplate": "{classname}-{title}",
"ancestorSeparator": "",
"usePathForSuiteName": "true"
}
}

0 comments on commit fd8261d

Please sign in to comment.