Skip to content

Merge pull request #4 from mediafellows/fix_apt_install #33

Merge pull request #4 from mediafellows/fix_apt_install

Merge pull request #4 from mediafellows/fix_apt_install #33

Workflow file for this run

---
name: Ansible-Test
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-20.04
env:
ANSIBLE_FORCE_COLOR: true
steps:
- name: Checkout code from Github
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install latest Ansible through pip
run: pip install ansible
- name: Output python and ansible versions
run: |
python --version
ansible --version
- name: Create ansible.cfg with correct roles_path
run: printf '[defaults]\nroles_path=../' > ansible.cfg
- name: Basic Ansible role syntax check
run: ansible-playbook -i tests/inventory --syntax-check tests/test.yml
- name: Real Ansible run
run: ansible-playbook -i tests/inventory tests/test.yml
- name: Second run to check for indempotence
run: "ansible-playbook -i tests/inventory tests/test.yml | grep -q 'changed=1.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)"
- name: Run nginx config test
run: sudo nginx -t
- name: Setup serverspec (install gem)
run: sudo gem install serverspec
- name: Run serverspec
run: rake spec