ci-kotlin.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: kotlin
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. jobs:
  8. build:
  9. name: test
  10. runs-on: ubuntu-latest
  11. services:
  12. postgres:
  13. image: postgres:11
  14. env:
  15. POSTGRES_USER: postgres
  16. POSTGRES_PASSWORD: postgres
  17. POSTGRES_DB: postgres
  18. ports:
  19. - 5432:5432
  20. # needed because the postgres container does not provide a healthcheck
  21. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  22. mysql:
  23. image: mysql:8
  24. env:
  25. MYSQL_ROOT_PASSWORD: mysecretpassword
  26. MYSQL_DATABASE: mysql
  27. ports:
  28. - 3306:3306
  29. steps:
  30. - uses: actions/checkout@v2.4.0
  31. - uses: actions/setup-java@v2
  32. with:
  33. distribution: 'adopt'
  34. java-version: '11'
  35. - uses: eskatos/gradle-command-action@v2
  36. env:
  37. PG_USER: postgres
  38. PG_HOST: localhost
  39. PG_DATABASE: postgres
  40. PG_PASSWORD: postgres
  41. PG_PORT: ${{ job.services.postgres.ports['5432'] }}
  42. MYSQL_DATABASE: mysql
  43. MYSQL_HOST: localhost
  44. MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
  45. MYSQL_ROOT_PASSWORD: mysecretpassword
  46. with:
  47. build-root-directory: examples/kotlin
  48. wrapper-directory: examples/kotlin
  49. arguments: test --scan