diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index a977fbad..dc41affe 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -1,20 +1,33 @@ 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: + 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 - - \ No newline at end of file + - run: npm run ${{ matrix.test }} + diff --git a/package.json b/package.json index 3fb729c0..bd66f74f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } }