integration_tests.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: mailcow Integration Tests
  2. on:
  3. push:
  4. branches: [ "master", "staging" ]
  5. workflow_dispatch:
  6. permissions:
  7. contents: read
  8. jobs:
  9. integration_tests:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Setup Ansible
  13. run: |
  14. export DEBIAN_FRONTEND=noninteractive
  15. sudo apt-get update
  16. sudo apt-get install python3 python3-pip git
  17. sudo pip3 install ansible
  18. - name: Prepair Test Environment
  19. run: |
  20. git clone https://github.com/mailcow/mailcow-integration-tests.git --branch $(curl -sL https://api.github.com/repos/mailcow/mailcow-integration-tests/releases/latest | jq -r '.tag_name') --single-branch .
  21. ./fork_check.sh
  22. ./ci.sh
  23. ./ci-pip-requirements.sh
  24. env:
  25. VAULT_PW: ${{ secrets.MAILCOW_TESTS_VAULT_PW }}
  26. VAULT_FILE: ${{ secrets.MAILCOW_TESTS_VAULT_FILE }}
  27. - name: Start Integration Test Server
  28. run: |
  29. ./fork_check.sh
  30. ansible-playbook mailcow-start-server.yml --diff
  31. env:
  32. PY_COLORS: '1'
  33. ANSIBLE_FORCE_COLOR: '1'
  34. ANSIBLE_HOST_KEY_CHECKING: 'false'
  35. - name: Setup Integration Test Server
  36. run: |
  37. ./fork_check.sh
  38. sleep 30
  39. ansible-playbook mailcow-setup-server.yml --private-key id_ssh_rsa --diff
  40. env:
  41. PY_COLORS: '1'
  42. ANSIBLE_FORCE_COLOR: '1'
  43. ANSIBLE_HOST_KEY_CHECKING: 'false'
  44. - name: Run Integration Tests
  45. run: |
  46. ./fork_check.sh
  47. ansible-playbook mailcow-integration-tests.yml --private-key id_ssh_rsa --diff
  48. env:
  49. PY_COLORS: '1'
  50. ANSIBLE_FORCE_COLOR: '1'
  51. ANSIBLE_HOST_KEY_CHECKING: 'false'
  52. - name: Delete Integration Test Server
  53. if: always()
  54. run: |
  55. ./fork_check.sh
  56. ansible-playbook mailcow-delete-server.yml --diff
  57. env:
  58. PY_COLORS: '1'
  59. ANSIBLE_FORCE_COLOR: '1'
  60. ANSIBLE_HOST_KEY_CHECKING: 'false'