ci.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: ci
  2. on:
  3. pull_request
  4. jobs:
  5. ci:
  6. runs-on: ubuntu-latest
  7. services:
  8. mysql:
  9. image: mysql:5
  10. env:
  11. MYSQL_ROOT_PASSWORD: password
  12. ports:
  13. - 13306:3306
  14. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  15. postgres:
  16. image: postgres:11
  17. env:
  18. POSTGRES_USER: postgres
  19. POSTGRES_PASSWORD: postgres
  20. ports:
  21. - 5432:5432
  22. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  23. strategy:
  24. matrix:
  25. dbs:
  26. - mysql
  27. - postgresql
  28. env:
  29. RAILS_ENV: test
  30. ZAMMAD_DBS: ${{ matrix.dbs }}
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@v1
  34. - name: Set up Ruby
  35. uses: ruby/setup-ruby@v1
  36. with:
  37. ruby-version: 2.7.4
  38. - name: Increase MySQL max_allowed_packet to 1GB (workaround for unknown/missing service option)
  39. run: |
  40. sudo apt-get install -y mysql-client
  41. mysql --host 127.0.0.1 --port 13306 -uroot -ppassword -e "SET GLOBAL max_allowed_packet=1073741824;"
  42. - name: CI
  43. run: .github/ci.sh