将工作服报告从 Travis-CI 迁移到 GitHub Actions

问题描述

我遵循了此设置指南:Integrating with coveralls.io 这对于 Travis-CI 来说是完美的,使用工作服和纽约。但是最近在迁移到 GitHub Actions 时,该步骤开始失败并出现以下错误:

> js-big-decimal@1.3.3 coverage /home/runner/work/js-big-decimal/js-big-decimal
> nyc report --reporter=text-lcov | coveralls


/home/runner/work/js-big-decimal/js-big-decimal/node_modules/coveralls/bin/coveralls.js:19
      throw err;
      ^
Bad response: 422 {"message":"Couldn't find a repository matching this job.","error":true}
(Use `node --trace-uncaught ...` to show where the exception was thrown)
npm ERR! code ELIFECYCLE

让它发挥作用的最佳方法是什么?

解决方法

  • 编辑 package.json 中的覆盖脚本以使用 lcov 的默认报告器
"coverage": nyc report --reporter=lcov
  • 修改管道以使用官方工作服阶段
    - name: Test
      run: |
        npm run ci-test
        npm run coverage

    - name: Publish to coveralls.io
      uses: coverallsapp/github-action@v1.1.2
      with:
        github-token: ${{ github.token }}

最初发布于 Ones and Zeros

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...