Skip to content

CI

CI #9

Workflow file for this run

---
name: CI
on:
push:
branches-ignore:
- main
- master
pull_request:
branches:
- main
- master
schedule:
- cron: '0 6 * * 0'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-lint yamllint
- name: Run yamllint
run: yamllint .
- name: Run ansible-lint
run: ansible-lint
syntax-check:
name: Syntax Check (Ansible ${{ matrix.ansible-version }})
runs-on: ubuntu-latest
strategy:
matrix:
ansible-version:
- '2.15'
- '2.16'
- '2.17'
- '2.18'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible
run: |
python -m pip install --upgrade pip
pip install "ansible-core~=${{ matrix.ansible-version }}"
- name: Check Ansible version
run: ansible --version
- name: Create ansible.cfg with correct roles_path
run: printf '[defaults]\nroles_path=../' >ansible.cfg
- name: Basic role syntax check
run: ansible-playbook tests/test.yml -i tests/inventory --syntax-check