1. Travis with Gradle - sftth/travis GitHub Wiki

1. ๊ฐœ์š”

  • Travis๋ฅผ ํ™œ์šฉํ•˜์—ฌ ํ”„๋กœ์ ํŠธ ๋นŒ๋“œ, ํ…Œ์ŠคํŠธ์ปค๋ฒ„๋ฆฌ์ง€ ํˆด ์—ฐ๋™, ํ…”๋ ˆ๊ทธ๋žจ ๋ด‡ ์—ฐ๋™ ์ˆ˜ํ–‰

2. ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

  • IntelliJ > File > New > Project

3. Github(Repository) ๊ณต์œ 

  • VCS > Import into version control > Share Project on Github

4. Travis ์—ฐ๋™

  • travis-ci.org > login with Github๋กœ ์ ‘์†
  • Repository ์„ ํƒ ๋ฐ ํ™œ์„ฑํ™”
  • .travis.yml ์ƒ์„ฑ
    language: java
    jdk:
      - openjdk8
    before_install:
      - chmod +x gradlew
    branches:
      only:
        - master
    #Travis CI ์„œ๋ฒ„ Cache ํ™œ์„ฑํ™”
    cache:
      directories:
        - '$HOME/.m2/repository'
        - '$HOME/.gradle'
    #clean ํ›„ Build(Build์‹œ ์ž๋™์œผ๋กœ test ์ˆ˜ํ–‰)
    script: "./gradlew clean build"
    
    after_success:
      - ./gradlew jacocoTestReport coveralls
    notifications:
      webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
    
  • ๋นŒ๋“œ ์ƒํƒœ ๋ผ๋ฒจ ๋ณต์‚ฌ
    • ๋นŒ๋“œ ์ƒํƒœ ๋ผ๋ฒจ ํด๋ฆญ > Markdown ๋ณต์‚ฌ
    • Github README.md์— ๋ณต์‚ฌ

5. Coverall ์—ฐ๋™

  • ๊ฐœ์š”
    • ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ๊ด€๋ฆฌ ์›น ์„œ๋น„์Šค
    • ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ์ธก์ • ๋„๊ตฌ(jacoco)์‹คํ–‰ > coveralls๋กœ ๊ฒฐ๊ณผ ์ „์†ก > coveralls์— ๊ฒฐ๊ณผ๋ฅผ ํ†ต๊ณ„๋กœ ๋‚จ๊น€
  • Github๋กœ ๋กœ๊ทธ์ธ
  • Sync Repos > On > Details > repo_token ๋ณต์‚ฌ
  • ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ ์ธก์ • ๋„๊ตฌ(jacoco)๋ฅผ Gradle์— ์ถ”๊ฐ€
    • build.gradle ์ฝ”๋“œ ์ถ”๊ฐ€
      plugins {
          ...
          id 'jacoco'
          id 'com.github.kt3k.coveralls' version '2.8.4'
      }
      ...
      jacocoTestReport{
         reports{
            xml.enabled = true
            html.enabled = true
         }
      }
      
  • .coveralls.yml ํŒŒ์ผ ์ƒ์„ฑ > repo_token ๋“ฑ๋ก
    repo_token: ${ํ† ํฐํ‚ค}
    

6. Telegram bot ์—ฐ๋™

  • ํ…”๋ ˆ๊ทธ๋žจ ์•ฑ ์„ค์น˜
  • ์—ฐ๋ฝ์ฒ˜์—์„œ Travis CI ๊ฒ€์ƒ‰
  • /start ์ž…๋ ฅ
  • /link ์ž…๋ ฅ
  • user/repo ์ž…๋ ฅ
  • Public ์ž…๋ ฅ
  • .travis.yml์— ์•„๋ž˜ ๋ผ์ธ ์ถ”๊ฐ€
    notifications:
    webhooks: https://####-####-#####.####.com/notify
    
  • Private chat ์ž…๋ ฅ
  • ์ดํ›„ ๋นŒ๋“œ ํ›„ ๊ฒฐ๊ณผ push ๋จ