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