-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.38 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run tests
on:
push:
branches: '**'
jobs:
tests:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.0.10"
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install Python dependencies
run: pip install --no-cache-dir --user ansible==9.5.1
- name: Setup OpenSSH Server
run: |
sudo apt update
sudo apt install --yes openssh-server=1:8.9p1-3ubuntu0.7
sudo apt install --yes tree
sudo service ssh start
- name: Initialize Terraform infrastructure
run: terraform init
working-directory: ./tests/setup
- name: Show VM metrics
run: cat /proc/cpuinfo && cat /proc/meminfo && df -h
# && du -h --max-depth=3 / | sort -rh | head -n 100
- name: Apply Terraform infrastructure
run: terraform apply --auto-approve
working-directory: ./tests/setup
- name: Run testsuite
run: ansible-playbook --inventory inventory.yml deploy.yml
working-directory: ./tests/testsuite
- name: Cleanup
if: always()
run: terraform destroy --auto-approve
working-directory: ./tests/setup