首页 > 解决方案 > 将工作服报告从 Travis-CI 迁移到 GitHub Actions

问题描述

我遵循了这个设置指南:与 Coveralls.io 集成 这对于 Travis-CI 来说是完美的,使用工作服和 nyc。但是最近在迁移到 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

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

标签: travis-cigithub-actionscoveralls

解决方案


  • 编辑 package.json 中的覆盖脚本以使用 lcov 的默认报告器
"coverage": nyc report --reporter=lcov
  • 修改管道以使用官方 Coveralls 阶段
    - 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 }}

最初发表于 1和 0


推荐阅读