在 GitHub 存储库中显示 Travis 构建状态 [英] Showing Travis build status in GitHub repo

查看:18
本文介绍了在 GitHub 存储库中显示 Travis 构建状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得最近在 GitHub 浏览存储库时看到了 pr 或 commit 的 Travis 构建状态(但找不到在哪里).我不是在谈论 README.md 中的 Travis 构建状态图像,而是实际的 GitHub 功能(带有友好复选标记的绿色框).

I remember recently seeing the Travis build status of a pr or commit in GitHub browsing the repository (but can't find where). I'm not talking about the Travis build status images in README.md but an actual GitHub feature (green box with a friendly check mark).

虽然我的提交基于 Travis 构建得很好,但我希望将结果显示在 GitHub 中(他们现在不这样做).我想知道如何启用它.

While my commits build on Travis just fine I'd like to get the results displayed in GitHub (which they don't do right now). I'd like to know how to enable this.

更新

在此处找到 示例 - 请参阅绿色小复选标记Travis-CI 构建通过"?

Found an example here - see the small green check mark saying "Travis-CI build passed"?

推荐答案

我给你我的例子 - https://github.com/simkimsia/实用程序行为

我在我的 README.mdown 中写了这个

I wrote this in my README.mdown

### Status
[![Build Status](https://travis-ci.org/simkimsia/UtilityBehaviors.png)](https://travis-ci.org/simkimsia/UtilityBehaviors)

所以答案是

[![Build Status](your travis url for the repo here.png)](your travis url for the repo here)

我意识到您的意思可能是打开 Travis 服务挂钩.

I realized that you may mean turning on the Travis Service Hook.

如果这是您的意思,请转到您的 github 存储库 > 设置 > 服务挂钩.使用 Ctrl+F 并搜索 Travis.

If that is what you mean, go to your github repo > Settings > Service Hooks. Use Ctrl+F and search for Travis.

转到https://travis-ci.org/profile/{填写您自己的用户名}/profile

Go to https://travis-ci.org/profile/{fill in your own usernam}/profile

然后复制令牌并将其粘贴到 Github 存储库设置部分的 Travis 服务挂钩页面中.

Then copy the token and paste it inside the Travis Service Hook page in your Github Repo Settings section.

在 Travis 中也输入您的用户名.

Type in your username in Travis as well.

试试测试发送令牌按钮.

Try the test send token button.

您应该会看到负载已成功发送.

You should see payload successfully sent.

如果可行,您的 github 存储库现在已连接到您的 travis.

If this works, your github repo is now hooked up to your travis.

OP 正在询问拉取请求页面中提交的 travis 构建状态.

The OP is asking about the travis build status for commits found in pull requests pages.

他认为只要有提交,travis 构建状态就会出现在任何地方.

He assumed that the travis build status will appear anywhere as long as there is a commit.

我的回答是假设不正确.

My answer is that the assumption is not correct.

这篇关于在 GitHub 存储库中显示 Travis 构建状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆