Mirror of Github Repo. https://github.com/flockingbird/roost
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.

test.yml 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # This workflow uses actions that are not certified by GitHub.
  2. # They are provided by a third-party and are governed by
  3. # separate terms of service, privacy policy, and support
  4. # documentation.
  5. # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
  6. # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
  7. name: Test
  8. on:
  9. push:
  10. branches: [ main, develop ]
  11. pull_request_target:
  12. types: [labeled]
  13. jobs:
  14. test:
  15. runs-on: ubuntu-latest
  16. if: contains(github.event.pull_request.labels.*.name, 'safe to test')
  17. ## We don't need encrypted secrets yet for booting a temp database container.
  18. env:
  19. APP_ENV: test
  20. MAIL_METHOD: test
  21. JWT_SECRET: 's3cr37'
  22. PORT: 3000
  23. DB_USER: postgres
  24. DB_HOST: localhost
  25. DB_PASSWORD: 'postgres'
  26. DB_NAME: roost_test
  27. DB_PORT: 5432
  28. DATABASE_URL: postgres://postgres:postgres@localhost:5432/roost_test
  29. services:
  30. postgres:
  31. image: postgres
  32. env:
  33. POSTGRES_PASSWORD: 'postgres'
  34. options: >-
  35. --health-cmd pg_isready
  36. --health-interval 10s
  37. --health-timeout 5s
  38. --health-retries 5
  39. ports:
  40. - 5432:5432
  41. steps:
  42. - uses: actions/checkout@v2
  43. # Please refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests
  44. # for issues this can cause. We mitigate it with requiring a tag to be set. Which only maintainers can add.
  45. with:
  46. ref: ${{ github.event.pull_request.head.sha }}
  47. - name: Set up Ruby
  48. uses: ruby/setup-ruby@v1
  49. with:
  50. ruby-version: 2.6
  51. - name: Install Dependencies
  52. run: bundle install
  53. - name: Setup Database
  54. run: make _db-setup
  55. - name: Run tests and upload coverage results
  56. uses: paambaati/codeclimate-action@v2.7.4
  57. with:
  58. coverageCommand: make
  59. env:
  60. CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}