test.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. s3:
  36. image: minio/minio:edge-cicd
  37. env:
  38. MINIO_DOMAIN: localhost # virtual hosted-style access
  39. MINIO_ROOT_USER: cleanpython
  40. MINIO_ROOT_PASSWORD: cleanpython
  41. ports:
  42. - 9000:9000
  43. steps:
  44. - uses: actions/checkout@v3
  45. - name: Set up Python ${{ matrix.python }}
  46. uses: actions/setup-python@v4
  47. with:
  48. python-version: ${{ matrix.python }}
  49. - name: Install python dependencies
  50. run: |
  51. pip install --disable-pip-version-check --upgrade pip setuptools
  52. pip install -e .[dramatiq,fastapi,auth,celery,fluentbit,sql,s3,api_client,amqp,test] ${{ matrix.pins }}
  53. pip list
  54. - name: Run tests
  55. run: pytest tests --cov
  56. - name: Wait for postgres
  57. run: scripts/wait-for-postgres.sh
  58. env:
  59. POSTGRES_URL: 'postgres:postgres@localhost:5432'
  60. timeout-minutes: 1
  61. - name: Run integration tests
  62. run: pytest integration_tests
  63. env:
  64. POSTGRES_URL: 'postgres:postgres@localhost:5432'
  65. S3_URL: 'http://localhost:9000'