Update ansible-core playbooks for v2.0.0 compatibility (#349) #1337
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: ansible-lint | |
| on: [push, pull_request] # noqa: yaml[truthy] | |
| jobs: | |
| build: | |
| name: Ansible Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies from Ansible Galaxy | |
| uses: ./.github/actions/install-requirements | |
| with: | |
| requirements: collections/requirements.yml | |
| - name: Install ansible-lint | |
| run: pip install ansible-lint | |
| # Equivalent local one-liner (for reference / local testing): | |
| # for dir in /Users/ddimatos/git/z_ansible_collections_samples/*/; do echo "=== Entering: $dir ===" && (cd "$dir" && ansible-lint *); done | |
| - name: Run ansible-lint | |
| env: | |
| ANSIBLE_LIBRARY: "${{ github.workspace }}/zos_subsystems/ims/ims_provisioning/library" | |
| run: | | |
| failed=() | |
| for dir in ${{ github.workspace }}/*/; do | |
| echo "" | |
| echo "===============================================" | |
| echo " Entering: $dir" | |
| echo "===============================================" | |
| echo "" | |
| if (cd "$dir" && ansible-lint *); then | |
| echo "[PASS] $dir" | |
| else | |
| echo "[FAIL] $dir" | |
| failed+=("$dir") | |
| fi | |
| done | |
| if [[ ${#failed[@]} -gt 0 ]]; then | |
| echo "" | |
| echo "The following directories failed:" | |
| for d in "${failed[@]}"; do | |
| echo " - $d" | |
| done | |
| exit 1 | |
| fi |