diff --git a/.github/matchers/tap.json b/.github/matchers/tap.json new file mode 100644 index 00000000..ef114199 --- /dev/null +++ b/.github/matchers/tap.json @@ -0,0 +1,32 @@ +{ + "//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.", + "problemMatcher": [ + { + "owner": "tap", + "pattern": [ + { + "regexp": "^\\s*not ok \\d+ - (.*)", + "message": 1 + }, + { + "regexp": "^\\s*---" + }, + { + "regexp": "^\\s*at:" + }, + { + "regexp": "^\\s*line:\\s*(\\d+)", + "line": 1 + }, + { + "regexp": "^\\s*column:\\s*(\\d+)", + "column": 1 + }, + { + "regexp": "^\\s*file:\\s*(.*)", + "file": 1 + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a62d9a1..e0bcea0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,5 +82,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts diff --git a/lib/content/ci.yml b/lib/content/ci.yml index bc62aff3..1bd995e6 100644 --- a/lib/content/ci.yml +++ b/lib/content/ci.yml @@ -55,5 +55,7 @@ jobs: steps: {{> setupGit}} {{> setupNode useMatrix=true}} + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts {{~#if isWorkspace}} -w {{pkgName}}{{/if}} diff --git a/lib/content/index.js b/lib/content/index.js index d30dc1b8..c4472565 100644 --- a/lib/content/index.js +++ b/lib/content/index.js @@ -9,6 +9,7 @@ const rootRepo = { '.github/ISSUE_TEMPLATE/config.yml': 'config.yml', '.github/CODEOWNERS': 'CODEOWNERS', '.github/dependabot.yml': 'dependabot.yml', + '.github/matchers/tap.json': 'tap.json', '.github/workflows/audit.yml': 'audit.yml', '.github/workflows/codeql-analysis.yml': 'codeql-analysis.yml', '.github/workflows/post-dependabot.yml': 'post-dependabot.yml', diff --git a/lib/content/tap.json b/lib/content/tap.json new file mode 100644 index 00000000..c15088a3 --- /dev/null +++ b/lib/content/tap.json @@ -0,0 +1,28 @@ +{ + "problemMatcher": [{ + "owner": "tap", + "pattern" : [ + { + "regexp": "^\\s*not ok \\d+ - (.*)", + "message": 1 + }, + { + "regexp": "^\\s*---" + }, + { + "regexp": "^\\s*at:" + }, + { + "regexp": "^\\s*line:\\s*(\\d+)", + "line": 1 + }, + { + "regexp": "^\\s*column:\\s*(\\d+)", + "column": 1 + }, { + "regexp": "^\\s*file:\\s*(.*)", + "file": 1 + } + ] + }] +} diff --git a/tap-snapshots/test/apply/full-content.js.test.cjs b/tap-snapshots/test/apply/full-content.js.test.cjs index a1c82ea7..7bed645b 100644 --- a/tap-snapshots/test/apply/full-content.js.test.cjs +++ b/tap-snapshots/test/apply/full-content.js.test.cjs @@ -128,6 +128,41 @@ updates: labels: - "Dependencies" +.github/matchers/tap.json +======================================== +{ + "//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.", + "problemMatcher": [ + { + "owner": "tap", + "pattern": [ + { + "regexp": "^/s*not ok /d+ - (.*)", + "message": 1 + }, + { + "regexp": "^/s*---" + }, + { + "regexp": "^/s*at:" + }, + { + "regexp": "^/s*line:/s*(/d+)", + "line": 1 + }, + { + "regexp": "^/s*column:/s*(/d+)", + "column": 1 + }, + { + "regexp": "^/s*file:/s*(.*)", + "file": 1 + } + ] + } + ] +} + .github/workflows/audit.yml ======================================== # This file is automatically added by @npmcli/template-oss. Do not edit. @@ -244,6 +279,8 @@ jobs: if: \${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts @@ -619,6 +656,41 @@ updates: labels: - "Dependencies" +.github/matchers/tap.json +======================================== +{ + "//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.", + "problemMatcher": [ + { + "owner": "tap", + "pattern": [ + { + "regexp": "^/s*not ok /d+ - (.*)", + "message": 1 + }, + { + "regexp": "^/s*---" + }, + { + "regexp": "^/s*at:" + }, + { + "regexp": "^/s*line:/s*(/d+)", + "line": 1 + }, + { + "regexp": "^/s*column:/s*(/d+)", + "column": 1 + }, + { + "regexp": "^/s*file:/s*(.*)", + "file": 1 + } + ] + } + ] +} + .github/workflows/audit.yml ======================================== # This file is automatically added by @npmcli/template-oss. Do not edit. @@ -739,6 +811,8 @@ jobs: if: \${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w bbb @@ -832,6 +906,8 @@ jobs: if: \${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w @name/aaaa @@ -921,6 +997,8 @@ jobs: if: \${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts diff --git a/tap-snapshots/test/apply/index.js.test.cjs b/tap-snapshots/test/apply/index.js.test.cjs index a2117b3f..fede8051 100644 --- a/tap-snapshots/test/apply/index.js.test.cjs +++ b/tap-snapshots/test/apply/index.js.test.cjs @@ -15,6 +15,7 @@ exports[`test/apply/index.js TAP turn off module > expect resolving Promise 1`] .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/dependabot.yml +.github/matchers/tap.json .github/workflows/audit.yml .github/workflows/ci.yml .github/workflows/codeql-analysis.yml diff --git a/tap-snapshots/test/check/diffs.js.test.cjs b/tap-snapshots/test/check/diffs.js.test.cjs index be5035cc..2a1af981 100644 --- a/tap-snapshots/test/check/diffs.js.test.cjs +++ b/tap-snapshots/test/check/diffs.js.test.cjs @@ -310,13 +310,11 @@ The repo file ci.yml needs to be updated: .github/workflows/ci.yml ======================================== - @@ -63,4 +63,24 @@ - git config --global user.name "npm CLI robot" - - uses: actions/setup-node@v3 + @@ -65,4 +65,24 @@ with: node-version: \${{ matrix.node-version }} - + - name: Update to workable npm (windows) - + # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows + - name: Update to workable npm (windows) + # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows + if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.')) + run: | + curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz @@ -333,6 +331,8 @@ The repo file ci.yml needs to be updated: + if: \${{ !startsWith(matrix.node-version, '10.') }} + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + + - name: add tap problem matcher + + run: echo "::add-matcher::.github/matchers/tap.json" + - run: npm i --ignore-scripts --no-audit --no-fund + - run: npm test --ignore-scripts diff --git a/tap-snapshots/test/check/index.js.test.cjs b/tap-snapshots/test/check/index.js.test.cjs index c1db699a..21cf6ec6 100644 --- a/tap-snapshots/test/check/index.js.test.cjs +++ b/tap-snapshots/test/check/index.js.test.cjs @@ -18,6 +18,7 @@ The following repo files need to be added: .github/ISSUE_TEMPLATE/config.yml .github/CODEOWNERS .github/dependabot.yml + .github/matchers/tap.json .github/workflows/audit.yml .github/workflows/codeql-analysis.yml .github/workflows/post-dependabot.yml @@ -97,6 +98,7 @@ The following repo files need to be added: .github/ISSUE_TEMPLATE/config.yml .github/CODEOWNERS .github/dependabot.yml + .github/matchers/tap.json .github/workflows/audit.yml .github/workflows/codeql-analysis.yml .github/workflows/post-dependabot.yml