Skip to content

restart

restart #29

Workflow file for this run

name: "Tests"
on:
push:
branches: "**"
env:
TERRAFORM_WORKING_DIRECTORY: "./tests/setup"
ANSIBLE_WORKING_DIRECTORY: "./tests/testsuite"
TESTSUITE_ARTIFACT: "testsuite-log.txt"
jobs:
setup:
runs-on: "self-hosted"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-node@v3"
- uses: "hashicorp/setup-terraform@v3"
with:
terraform_version: "1.0.10"
- 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: "Initialize Terraform infrastructure"
run: "terraform init"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"
- name: "Apply Terraform infrastructure"
run: "terraform apply --auto-approve"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"
testsuite:
runs-on: "self-hosted"
needs: "setup"
steps:
- name: "Run Ansible testsuite"
run: "ansible-playbook --inventory inventory.yml deploy.yml | tee ${{ env.TESTSUITE_ARTIFACT }}"
working-directory: ${{ env.ANSIBLE_WORKING_DIRECTORY }}
- uses: "actions/upload-artifact@v3"
if: "${{ always() }}"
with:
path: "${{ env.TESTSUITE_ARTIFACT }}"
cleanup:
runs-on: "self-hosted"
needs: ["setup", "testsuite"]
if: "${{ always() }}"
steps:
- name: "Destroy Terraform environment"
run: "terraform destroy --auto-approve"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"