CI #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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 |