.drone.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. ################
  3. # Build & Test #
  4. ################
  5. kind: pipeline
  6. name: run_tests
  7. steps:
  8. # Run tests against Python/Flask engine backend (with pytest)
  9. - name: coverage
  10. image: python:3.10.4
  11. commands:
  12. # Install dependencies
  13. - cp vrobbler.conf.test vrobbler.conf
  14. - pip install poetry
  15. - poetry install
  16. # Start with a fresh database (which is already running as a service from Drone)
  17. - poetry run pytest --cov-report term --cov=vrobbler tests
  18. environment:
  19. VROBBLER_DATABASE_URL: sqlite:///test.db
  20. volumes:
  21. # Mount pip cache from host
  22. - name: pip_cache
  23. path: /root/.cache/pip
  24. - name: pytest
  25. image: python:3.10.4
  26. commands:
  27. # Install dependencies
  28. - cp vrobbler.conf.test vrobbler.conf
  29. - pip install poetry
  30. - poetry install
  31. # Start with a fresh database (which is already running as a service from Drone)
  32. - poetry run pytest
  33. environment:
  34. VROBBLER_DATABASE_URL: sqlite:///test.db
  35. volumes:
  36. # Mount pip cache from host
  37. - name: pip_cache
  38. path: /root/.cache/pip
  39. volumes:
  40. - name: docker
  41. host:
  42. path: /var/run/docker.sock
  43. - name: pip_cache
  44. host:
  45. path: /tmp/cache/drone/pip