test.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Linux
  2. # Run on PR requests. And on master itself.
  3. on:
  4. push:
  5. branches:
  6. - main
  7. pull_request:
  8. jobs:
  9. test:
  10. name: Test, Linux, Python ${{ matrix.python }}
  11. runs-on: ubuntu-latest
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. include:
  16. # 2019
  17. - python: 3.8
  18. pins: ""
  19. # 2021
  20. - python: 3.9
  21. pins: ""
  22. # 2022
  23. - python: "3.10"
  24. pins: ""
  25. # current
  26. - python: "3.11"
  27. pins: ""
  28. services:
  29. postgres:
  30. image: postgres:14-alpine
  31. env:
  32. POSTGRES_PASSWORD: postgres
  33. ports:
  34. - 5432:5432
  35. steps:
  36. - uses: actions/checkout@v3
  37. - name: Set up Python ${{ matrix.python }}
  38. uses: actions/setup-python@v4
  39. with:
  40. python-version: ${{ matrix.python }}
  41. - name: Install python dependencies
  42. run: |
  43. pip install --disable-pip-version-check --upgrade pip setuptools
  44. pip install -e .[dramatiq,fastapi,auth,celery,fluentbit,sql,test] ${{ matrix.pins }}
  45. pip list
  46. - name: Run tests
  47. run: pytest tests --cov
  48. - name: Wait for postgres
  49. run: scripts/wait-for-postgres.sh
  50. env:
  51. POSTGRES_URL: 'postgres:postgres@localhost:5432'
  52. timeout-minutes: 1
  53. - name: Run integration tests
  54. run: pytest integration_tests
  55. env:
  56. POSTGRES_URL: 'postgres:postgres@localhost:5432'