{"id":17724614,"url":"https://github.com/liumapp/hello-travis-ci","last_synced_at":"2025-07-07T05:03:51.132Z","repository":{"id":105178680,"uuid":"165013400","full_name":"liumapp/hello-travis-ci","owner":"liumapp","description":"Travis CI 教程，主要介绍如何使用Travis CI的检验代码功能和Code Review功能.  A tutorial of Travis CI mainly introduces how to use Travis CI's checking code function and Code Review function.","archived":false,"fork":false,"pushed_at":"2019-01-11T07:08:21.000Z","size":2126,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-04T05:48:42.854Z","etag":null,"topics":["code-review","gradle","java","travic-ci"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liumapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-10T07:38:56.000Z","updated_at":"2021-12-30T02:17:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"aee9462b-0bc2-4558-9ed3-204b686ee7ce","html_url":"https://github.com/liumapp/hello-travis-ci","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/liumapp/hello-travis-ci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liumapp%2Fhello-travis-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liumapp%2Fhello-travis-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liumapp%2Fhello-travis-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liumapp%2Fhello-travis-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liumapp","download_url":"https://codeload.github.com/liumapp/hello-travis-ci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liumapp%2Fhello-travis-ci/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264016712,"owners_count":23544624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-review","gradle","java","travic-ci"],"created_at":"2024-10-25T15:47:24.554Z","updated_at":"2025-07-07T05:03:51.111Z","avatar_url":"https://github.com/liumapp.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-travis-ci  \n\nTravis CI 教程，主要介绍如何使用Travis CI的检验代码功能和Code Review功能. \n\nA tutorial of Travis CI mainly introduces how to use Travis CI's checking code function and Code Review function.\n\n## 目录\n\n* [1. 检验代码](#1-检验代码)\n    * [1.1 注册Travis-CI](#11-注册Travis-CI)\n    * [1.2 配置Travis-CI](#12-配置Travis-CI)\n    * [1.3 查看Travis-CI编译效果](#13-查看Travis-CI编译效果)\n* [2. Code Review](#2-Code-Review)\n* [3. 总结](#3-总结)        \n\n                                                                                                            \n## 1. 检验代码\n\n### 1.1 注册Travis-CI\n\n在GitHub的marketplace中搜索Travis CI，然后下载，并关联自己的GitHub账号\n\nps: Travis CI只支持在GitHub使用\n\n![register.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/register.png?raw=true)\n\n### 1.2 配置Travis-CI\n\n老版本的Travis CI需要登陆它的官网：https://travis-ci.com 选中项目来开启，但是通过GitHub的marketplace关联后，是默认支持所有项目，所以不再需要走这一步\n\n直接在项目中创建一个\".travis.yml\"文件\n\n添加以下内容:\n\n````yml\nlanguage: java\ninstall: true\nscript: gradle build\njdk: oraclejdk8\n````\n\n在Java项目中，我们常用的依赖管理工具就是Maven和Gradle，Travis CI默认是Maven3进行编译，所以当我们的项目使用Gradle的时候，需要配置它的script去使用Gradle\n\nps: gradlew是Gradle在Linux环境下的可执行脚本文件\n\n### 1.3 查看Travis-CI编译效果\n\n走到这一步后，我们每一次提交代码，都会触发Travis CI去检验代码的事件\n\n登陆Travis CI的官网，找到我们的hello-travis-ci项目，就能够直观的查看每一次编译结果：\n\n![list.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/list.png?raw=true)\n\n如果编译失败的话，点击进去也可以查看具体问题出现在哪儿（travis ci自己会提供编译环境）\n\n![detail.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/detail.png?raw=true)\n\n## 2. Code Review\n\n通过Travis-CI是可以实现Code Review的\n\n要做code review，肯定是在两个人以上的团队作业形式才能开展\n\n参与方通过Fork项目后，发起PR，然后项目维护方负责对PR进行 code review，并指定由哪一个具体的人员进行code review\n\n在参与方发起pr后的流程如下所示：\n\n* 选择review负责人，如下图所示：\n\n    ![choice_reviewer.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/choice_reviewer.png?raw=true)\n\n* 选择完成后，该review负责人登录GitHub，将会查看到提示执行code review的信息，如下图所示：\n\n    ![add_review.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/add_review.png?raw=true)\n\n* review负责人审核代码，然后签署审核意见，常用的操作就是留下审核意见，并执行同意合并或者拒绝合并，如下图所示：\n\n    ![review_detail.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/review_detail.png?raw=true)\n\n* review负责人的审核结果，项目团队可以查看具体的审核结果（当然也包括了travis-ci的编译测试结果），如下所示：\n\n    ![check_review.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/check_review.png?raw=true)\n\n    以及\n    \n    ![review_result.png](https://github.com/liumapp/hello-travis-ci/blob/master/data/pic/review_result.png?raw=true)    \n    \n## 3. 总结\n\n如果您已经看到这里了，就给我一个star吧，让我有动力继续更新和编写更多的教程\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliumapp%2Fhello-travis-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliumapp%2Fhello-travis-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliumapp%2Fhello-travis-ci/lists"}