ci.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: CI
  2. on:
  3. pull_request:
  4. schedule:
  5. # Run every on Friday to ensure everything works as expected.
  6. - cron: '0 6 * * 5'
  7. jobs:
  8. CI:
  9. runs-on: ubuntu-latest
  10. container:
  11. image: zammad/zammad-ci:latest
  12. services:
  13. postgresql:
  14. image: postgres:16
  15. env:
  16. POSTGRES_USER: zammad
  17. POSTGRES_PASSWORD: zammad
  18. redis:
  19. # Use Redis 5 which is shipped in Debian 10.
  20. image: redis:5
  21. env:
  22. RAILS_ENV: test
  23. Z_LOCALES: "en-us:de-de"
  24. TZ: 'Europe/London'
  25. REDIS_URL: redis://redis:6379
  26. # Compile assets only once.
  27. CI_SKIP_ASSETS_PRECOMPILE: 'true'
  28. # Avoid unnecessary DB resets.
  29. CI_SKIP_DB_RESET: 'true'
  30. steps:
  31. - name: Checkout
  32. uses: actions/checkout@v4
  33. - name: Cache node modules
  34. id: cache-npm
  35. uses: actions/cache@v4
  36. with:
  37. path: .yarn/cache
  38. key: ${{ runner.os }}-cache-npm-${{ hashFiles('yarn.lock') }}
  39. - name: Cache Rubygems
  40. id: cache-bundler
  41. uses: actions/cache@v4
  42. with:
  43. path: vendor/ruby
  44. key: ${{ runner.os }}-cache-bundler-${{ hashFiles('Gemfile.lock') }}
  45. - name: Pre
  46. run: .github/workflows/ci/pre.sh
  47. - name: Lint
  48. run: .github/workflows/ci/lint.sh
  49. - name: Test
  50. run: .github/workflows/ci/test.sh