ぼざクリ タグ広場 https://hub.nizika.monster
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.
 
 
 
 
 
 

67 lines
1.5 KiB

  1. name: CI
  2. on:
  3. pull_request:
  4. push:
  5. branches: [ main ]
  6. jobs:
  7. scan_ruby:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout code
  11. uses: actions/checkout@v4
  12. - name: Set up Ruby
  13. uses: ruby/setup-ruby@v1
  14. with:
  15. ruby-version: .ruby-version
  16. bundler-cache: true
  17. - name: Scan for common Rails security vulnerabilities using static analysis
  18. run: bin/brakeman --no-pager
  19. lint:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: Checkout code
  23. uses: actions/checkout@v4
  24. - name: Set up Ruby
  25. uses: ruby/setup-ruby@v1
  26. with:
  27. ruby-version: .ruby-version
  28. bundler-cache: true
  29. - name: Lint code for consistent style
  30. run: bin/rubocop -f github
  31. test:
  32. runs-on: ubuntu-latest
  33. # services:
  34. # redis:
  35. # image: redis
  36. # ports:
  37. # - 6379:6379
  38. # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
  39. steps:
  40. - name: Install packages
  41. run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config
  42. - name: Checkout code
  43. uses: actions/checkout@v4
  44. - name: Set up Ruby
  45. uses: ruby/setup-ruby@v1
  46. with:
  47. ruby-version: .ruby-version
  48. bundler-cache: true
  49. - name: Run tests
  50. env:
  51. RAILS_ENV: test
  52. # REDIS_URL: redis://localhost:6379/0
  53. run: bin/rails db:test:prepare test