You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
5.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. ---
  2. name: Continuous Integration
  3. on:
  4. pull_request:
  5. branches: ["*", series/*]
  6. paths-ignore:
  7. - ".dockerignore"
  8. - ".github/workflow/ci.yml"
  9. - "Changelog.md"
  10. - "Dockerfile"
  11. - "doc/**"
  12. - "docker/**"
  13. - "LICENSE"
  14. - "README.md"
  15. # - "tests/e2e/**"
  16. push:
  17. branches: ["*", series/*]
  18. tags: [v*]
  19. paths-ignore:
  20. - ".dockerignore"
  21. - ".github/workflow/ci.yml"
  22. - "Changelog.md"
  23. - "Dockerfile"
  24. - "doc/**"
  25. - "docker/**"
  26. - "LICENSE"
  27. - "README.md"
  28. # - "tests/e2e/**"
  29. jobs:
  30. build:
  31. name: Build and Test
  32. runs-on: ubuntu-latest
  33. env:
  34. HTTP4S_DEMO_CODEGEN_DB_HOST: localhost
  35. HTTP4S_DEMO_CODEGEN_DB_PORT: 5432
  36. HTTP4S_DEMO_CODEGEN_DB_USER: codegenuser
  37. HTTP4S_DEMO_CODEGEN_DB_PASSWORD: postgres
  38. HTTP4S_DEMO_CODEGEN_DB_NAME: codegendb
  39. services:
  40. postgres:
  41. image: postgres:12-alpine
  42. env:
  43. POSTGRES_PASSWORD: postgres
  44. POSTGRES_USER: codegenuser
  45. POSTGRES_DB: codegendb
  46. # Set health checks to wait until postgres has started
  47. options: >-
  48. --health-cmd pg_isready
  49. --health-interval 10s
  50. --health-timeout 5s
  51. --health-retries 5
  52. ports:
  53. - 5432:5432
  54. steps:
  55. - name: Check out repository code
  56. uses: actions/checkout@v2
  57. - name: Coursier cache
  58. uses: coursier/cache-action@v6
  59. - name: Setup
  60. uses: olafurpg/setup-scala@v10
  61. with:
  62. java-version: adopt@1.11
  63. - name: Migrate
  64. run: csbt flyway/flywayMigrate
  65. - name: Lint
  66. run: csbt lint-check
  67. - name: Compile
  68. run: |
  69. csbt "compile; test:compile"
  70. - name: Run Unit Tests
  71. run: |
  72. csbt test
  73. - name: Run Integration Tests
  74. run: |
  75. csbt it:test
  76. publish:
  77. name: Publish Release Docker Image
  78. needs: [build]
  79. if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
  80. runs-on: ubuntu-latest
  81. env:
  82. HTTP4S_DEMO_CODEGEN_DB_HOST: localhost
  83. HTTP4S_DEMO_CODEGEN_DB_PORT: 5432
  84. HTTP4S_DEMO_CODEGEN_DB_USER: codegenuser
  85. HTTP4S_DEMO_CODEGEN_DB_PASSWORD: postgres
  86. HTTP4S_DEMO_CODEGEN_DB_NAME: codegendb
  87. HTTP4S_DEMO_DOCKER_JAVA_IMAGE: azul/zulu-openjdk-alpine:11-jre-headless
  88. services:
  89. postgres:
  90. image: postgres:12-alpine
  91. env:
  92. POSTGRES_PASSWORD: postgres
  93. POSTGRES_USER: codegenuser
  94. POSTGRES_DB: codegendb
  95. # Set health checks to wait until postgres has started
  96. options: >-
  97. --health-cmd pg_isready
  98. --health-interval 10s
  99. --health-timeout 5s
  100. --health-retries 5
  101. ports:
  102. - 5432:5432
  103. steps:
  104. - name: Check out repository code
  105. uses: actions/checkout@v2
  106. - name: Coursier cache
  107. uses: coursier/cache-action@v6
  108. - name: Setup
  109. uses: olafurpg/setup-scala@v10
  110. with:
  111. java-version: adopt@1.11
  112. - name: Login to Docker Hub
  113. uses: docker/login-action@v1
  114. with:
  115. username: rohansircar
  116. password: ${{ secrets.DOCKER_LOGIN_PASSWORD }}
  117. - name: Migrate
  118. run: csbt flyway/flywayMigrate
  119. - name: Publish Tag
  120. if: startsWith(github.ref, 'refs/tags/v')
  121. run: |
  122. csbt docker:publish
  123. - name: Publish Latest
  124. if: github.ref == 'refs/heads/main'
  125. env:
  126. DOCKER_PUBLISH_TAG: latest
  127. run: |
  128. csbt docker:publish
  129. publish-devel:
  130. name: Publish Devel Docker Image
  131. needs: [build]
  132. if: github.event_name != 'pull_request' && github.ref == 'refs/heads/devel'
  133. runs-on: ubuntu-latest
  134. env:
  135. HTTP4S_DEMO_CODEGEN_DB_HOST: localhost
  136. HTTP4S_DEMO_CODEGEN_DB_PORT: 5432
  137. HTTP4S_DEMO_CODEGEN_DB_USER: codegenuser
  138. HTTP4S_DEMO_CODEGEN_DB_PASSWORD: postgres
  139. HTTP4S_DEMO_CODEGEN_DB_NAME: codegendb
  140. HTTP4S_DEMO_DOCKER_JAVA_IMAGE: azul/zulu-openjdk-alpine:11-jre-headless
  141. HTTP4S_DEMO_DOCKER_PUBLISH_TAG: devel
  142. services:
  143. postgres:
  144. image: postgres:12-alpine
  145. env:
  146. POSTGRES_PASSWORD: postgres
  147. POSTGRES_USER: codegenuser
  148. POSTGRES_DB: codegendb
  149. # Set health checks to wait until postgres has started
  150. options: >-
  151. --health-cmd pg_isready
  152. --health-interval 10s
  153. --health-timeout 5s
  154. --health-retries 5
  155. ports:
  156. - 5432:5432
  157. steps:
  158. - name: Check out repository code
  159. uses: actions/checkout@v2
  160. - name: Coursier cache
  161. uses: coursier/cache-action@v6
  162. - name: Setup
  163. uses: olafurpg/setup-scala@v10
  164. with:
  165. java-version: adopt@1.11
  166. - name: Login to Docker Hub
  167. uses: docker/login-action@v1
  168. with:
  169. username: rohansircar
  170. password: ${{ secrets.DOCKER_LOGIN_PASSWORD }}
  171. - name: Migrate
  172. run: csbt flyway/flywayMigrate
  173. - name: Publish
  174. run: |
  175. csbt docker:publish