Skip to content

Commit

Permalink
Merge pull request #77 from dell/fix-ansible-lint
Browse files Browse the repository at this point in the history
Update ansible-test to use the github action from ansible common content
  • Loading branch information
trisha-dell authored Feb 3, 2025
2 parents 732991c + 44cf188 commit 2b680a7
Showing 1 changed file with 6 additions and 53 deletions.
59 changes: 6 additions & 53 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ansible-version: [stable-2.15, stable-2.16, stable-2.17, devel]
ansible-version: [stable-2.18]
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12

- name: Install ansible (${{ matrix.ansible-version }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
Expand All @@ -31,7 +31,7 @@ jobs:
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"

- name: Store migrated collection artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: collection
path: .cache/collection-tarballs
Expand Down Expand Up @@ -109,53 +109,6 @@ jobs:
pull-request-change-detection: true
coverage: never

lint:
name: Ansible lint
runs-on: ubuntu-latest
ansible-lint:
needs: [build]
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
ansible-version: [stable-2.15, stable-2.16, stable-2.17, devel]
exclude:
# Ansible-core 2.16 is supported only from Python 3.10 onwards
- python-version: "3.9"
ansible-version: stable-2.16
- python-version: "3.9"
ansible-version: stable-2.17
- python-version: "3.9"
ansible-version: devel
- python-version: "3.10"
ansible-version: devel

steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- name: Checkout the source code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for progressive mode to work

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install ansible (${{ matrix.ansible-version }}) version
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check

- name: Install ansible lint
run: pip install ansible-lint --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v3
with:
name: collection
path: .cache/collection-tarballs

- name: Install collection build
run: ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz

- name: Run Ansible lint
run: ansible-lint --show-relpath
working-directory: /home/runner/work/ansible-powerflex/ansible-powerflex
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main

0 comments on commit 2b680a7

Please sign in to comment.