Skip to content

Commit

Permalink
check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
szachovy committed Jun 29, 2024
1 parent efaded9 commit 1de0cba
Showing 1 changed file with 30 additions and 32 deletions.
62 changes: 30 additions & 32 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,49 @@
name: Tests
name: "Tests"

on:
push:
branches: '**'
branches: "**"

env:
TERRAFORM_WORKING_DIR: ./tests/setup
ANSIBLE_WORKING_DIR: ./tests/testsuite
TERRAFORM_WORKING_DIRECTORY: "./tests/setup"
ANSIBLE_WORKING_DIRECTORY: "./tests/testsuite"

jobs:
setup:
runs-on: self-hosted
runs-on: "self-hosted"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: hashicorp/setup-terraform@v3
- 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"

Check failure on line 23 in .github/workflows/tests.yml

View workflow job for this annotation

GitHub Actions / run-ansible-lint

yaml[trailing-spaces]

Trailing spaces
- name: "Install Python dependencies"
run: "pip install --no-cache-dir --user ansible==9.5.1"

Check failure on line 26 in .github/workflows/tests.yml

View workflow job for this annotation

GitHub Actions / run-ansible-lint

yaml[trailing-spaces]

Trailing spaces
- name: Initialize Terraform infrastructure
run: terraform init
working-directory: ${{ env.TERRAFORM_WORKING_DIR }}
- name: "Initialize Terraform infrastructure"
run: "terraform init"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"

Check failure on line 30 in .github/workflows/tests.yml

View workflow job for this annotation

GitHub Actions / run-ansible-lint

yaml[trailing-spaces]

Trailing spaces
- name: Apply Terraform infrastructure
run: terraform apply --auto-approve
working-directory: ${{ env.TERRAFORM_WORKING_DIR }}
- name: "Apply Terraform infrastructure"
run: "terraform apply --auto-approve"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"

testsuite:
runs-on: self-hosted
needs: setup
runs-on: "self-hosted"
needs: "setup"
steps:
- 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: Run Ansible testsuite
run: ansible-playbook --inventory inventory.yml deploy.yml
working-directory: ${{ env.ANSIBLE_WORKING_DIR }}
- name: "Run Ansible testsuite"
run: "ansible-playbook --inventory inventory.yml deploy.yml"
working-directory: "${{ env.ANSIBLE_WORKING_DIRECTORY }}"

cleanup:
runs-on: self-hosted
needs: testsuite
runs-on: "self-hosted"
steps:
- name: Destroy Terraform environment
if: always()
run: terraform destroy --auto-approve
working-directory: ${{ env.TERRAFORM_WORKING_DIR }}
- name: "Destroy Terraform environment"
if: "${{ always() }}"
run: "terraform destroy --auto-approve"
working-directory: "${{ env.TERRAFORM_WORKING_DIRECTORY }}"

0 comments on commit 1de0cba

Please sign in to comment.