如何使用Github Action配置工作服? [英] How to configure Coveralls with Github Action?
问题描述
我的github回购配置遇到问题.在这里-
93.43%
,平均所有内容为 89.4%
)我在做错什么,我应该怎么做才能解决这个问题?
我也尝试了很多事情,最后, 直接方法(不起作用): 使用GH市场中的操作"应用程序(有效): 这是上的工作方法.yml配置,希望它也会对其他人有所帮助. 请记住,我需要介绍的场景有些棘手,我们有多个需要覆盖的覆盖范围结果,需要将它们组合起来,然后再作为单个输出结果用于Coveralls.io. 如果有人好奇,这是我尝试过但失败的事情: 使用NODE_ENV进行发布- 运行: NODE_ENV = test cat ./coverage/lcov.info |./node_modules/coveralls/bin/coveralls.js 指定确切的节点版本 11.8.0及更高版本 为步骤指定 github.token,repo和env : 创建单独的 Github Actions作业. I'm experiencing problems with my github repo configuration. Here it is - umbress. I have Github Actions CI enabled and configured and I want to have the coverage badge in my repo so everyone who wants to use my code in their projects knows that my code is well-tested. But it seems that I missing something because my coverage badge has an "unknown" status for a long time already. CI steps are: There are a few issues: What am I doing wrong and what should I do to fix this? I've tried many things as well and in the end, the usage of the coverallsapp/github-action@v1.1.2 helped! Now I can successfully publish the coverage results to coveralls.io Unfortunately, the straightforward approach was either leading to "Bad Response 422 - Couldn't find a repository matching this job" or "Error from lcovParse: 'Failed to parse string'". Straightforward approach (not working): Using Actions app from GH marketplace (working): This is the working .yml configuration, hope it will help someone else as well. Keep in mind that the scenario that I needed to cover was a little bit tricky, we have multiple coverage results that needed to be combined and later on used as a single output result to coveralls.io. If someone is curious, here are the things that I've tried, but failed: Use of NODE_ENV for publishing - run: NODE_ENV=test cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js Specifying exact node version 11.8.0 and above Specifying a github.token, repo and env for the steps: Creating a separate Github Actions Job.
这篇关于如何使用Github Action配置工作服?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-名称:发布到Coveralls.io运行:cat./coverage/lcov.info./node_modules/coveralls/bin/coveralls.js
-名称:发布到Coveralls.io用途:coverallsapp/github-action@v1.1.2和:github-令牌:$ {{github.token}}
用途:actions/setup-node @ v1和:回购令牌:$ {{github.token}}仓库:$ {{github.repository}}GITHUB_TOKEN:$ {{github.token}}
jest --coverage --config config/jest.js
). This will generate ./coverage/lcov.info
in root directory
FIRST BUILD ON DEVELOPER AT 90.072%
, but there's no such percentage at all! Lines covered is 93.43%
and everything in average is 89.4%
)- name: Publish to coveralls.io
run: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ github.token }}
uses: actions/setup-node@v1
with:
repo-token: ${{ github.token }}
repository: ${{ github.repository }}
GITHUB_TOKEN: ${{ github.token }}