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.

55 lines
1.5 KiB

  1. name: Django CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. test:
  9. runs-on: ubuntu-20.04
  10. strategy:
  11. matrix:
  12. db: [sqlite, postgres, mysql]
  13. python-version: [3.6, 3.7, 3.8]
  14. include:
  15. - db: postgres
  16. db_user: runner
  17. db_password: ''
  18. - db: mysql
  19. db_user: root
  20. db_password: root
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Set up Python ${{ matrix.python-version }}
  24. uses: actions/setup-python@v2
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. - name: Start MySQL
  28. if: matrix.db == 'mysql'
  29. run: sudo systemctl start mysql.service
  30. - name: Start PostgreSQL
  31. if: matrix.db == 'postgres'
  32. run: |
  33. sudo systemctl start postgresql.service
  34. sudo -u postgres createuser -s runner
  35. - name: Install Dependencies
  36. run: |
  37. python -m pip install --upgrade pip
  38. pip install -r requirements.txt
  39. pip install apprise braintree coverage coveralls mysqlclient
  40. - name: Run Tests
  41. env:
  42. DB: ${{ matrix.db }}
  43. DB_USER: ${{ matrix.db_user }}
  44. DB_PASSWORD: ${{ matrix.db_password }}
  45. SECRET_KEY: dummy-key
  46. run: |
  47. coverage run --omit=*/tests/* --source=hc manage.py test
  48. - name: Coveralls
  49. if: matrix.db == 'postgres' && matrix.python-version == '3.8'
  50. run: coveralls --service=github
  51. env:
  52. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}