packer-rocm/actions: init (lint) #3
Workflow file for this run
This file contains 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: Lint 'packer-rocm' | |
on: | |
push: | |
paths: | |
- 'packer-rocm/**' | |
pull_request: | |
paths: | |
- 'packer-rocm/**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
- uses: actions/[email protected] | |
with: | |
python-version: "3.x" | |
cache: 'pip' | |
- name: Cache Ansible Collections | |
uses: actions/cache@v4 | |
with: | |
path: ~/.ansible/collections | |
key: ansible-collections-${{ hashFiles('packer-rocm/requirements.yml') }} | |
- name: Install Ansible/Collections | |
run: | | |
pip install ansible-core ansible-lint | |
ansible-galaxy collection install -r packer-rocm/requirements.yml | |
- name: Run 'ansible-lint' | |
run: | | |
ansible-lint --profile production --parseable --nocolor | |
# if Ansible is good, set up Packer/test HCL | |
- name: Setup `packer` | |
uses: [email protected] | |
id: setup | |
with: | |
version: "latest" |