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.

80 lines
2.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. name: Django CI
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. jobs:
  8. build:
  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_port: 5432
  17. - db: mysql
  18. db_port: 3306
  19. services:
  20. postgres:
  21. image: postgres:10
  22. env:
  23. POSTGRES_USER: postgres
  24. POSTGRES_PASSWORD: hunter2
  25. options: >-
  26. --health-cmd pg_isready
  27. --health-interval 10s
  28. --health-timeout 5s
  29. --health-retries 5
  30. ports:
  31. - 5432:5432
  32. mysql:
  33. image: mysql:5.7
  34. env:
  35. MYSQL_ROOT_PASSWORD: hunter2
  36. ports:
  37. - 3306:3306
  38. options: >-
  39. --health-cmd="mysqladmin ping"
  40. --health-interval=10s
  41. --health-timeout=5s
  42. --health-retries=3
  43. steps:
  44. - uses: actions/checkout@v2
  45. - name: Set up Python ${{ matrix.python-version }}
  46. uses: actions/setup-python@v2
  47. with:
  48. python-version: ${{ matrix.python-version }}
  49. - name: Install Dependencies
  50. run: |
  51. python -m pip install --upgrade pip
  52. pip install -r requirements.txt
  53. pip install apprise braintree coverage mysqlclient
  54. - name: Run Tests
  55. env:
  56. DB: ${{ matrix.db }}
  57. DB_HOST: 127.0.0.1
  58. DB_PORT: ${{ matrix.db_port }}
  59. DB_PASSWORD: hunter2
  60. run: |
  61. coverage run --omit=*/tests/* --source=hc manage.py test
  62. - name: Coveralls Parallel
  63. uses: coverallsapp/github-action@master
  64. with:
  65. github-token: ${{ secrets.github_token }}
  66. flag-name: run-${{ matrix.python-version }}-${{ matrix.db }}
  67. parallel: true
  68. finish:
  69. needs: build
  70. runs-on: ubuntu-20.04
  71. steps:
  72. - name: Coveralls Finished
  73. uses: coverallsapp/github-action@master
  74. with:
  75. github-token: ${{ secrets.github_token }}
  76. parallel-finished: true