Skip to content

Commit ed43001

Browse files
committed
CI: Install ansible-core from PyPI
Installing ansible from source leads to reinstallation when installing ansible-lint, pulling in the latest version, which can fail due to the ansible-base/ansible-core package being present. Install from PyPI instead.
1 parent 4f968b4 commit ed43001

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/pull_request.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,29 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
ansible:
18-
- stable-2.9
19-
- stable-2.10
20-
- devel
18+
- "2.9"
19+
- "2.10"
20+
- "2.12"
2121
steps:
2222
# Checks-out the repository under $GITHUB_WORKSPACE, so it's accessible to the job
2323
- uses: actions/checkout@v2
2424

25+
- uses: actions/setup-python@v2
26+
2527
- name: Install dependencies
2628
run: |
2729
python -m pip install --upgrade pip
28-
pip install git+https://github.com/ansible/ansible.git@${{ matrix.ansible }}
29-
pip install 'ansible-lint<5'
30+
if [[ "${{ matrix.ansible }}" = "2.9" ]]; then
31+
ansible_package=ansible
32+
elif [[ "${{ matrix.ansible }}" = "2.10" ]]; then
33+
ansible_package=ansible-base
34+
else
35+
ansible_package=ansible-core
36+
fi
37+
pip install $ansible_package==${{ matrix.ansible }}.* 'ansible-lint==5.*'
38+
39+
- name: Install Ansible Galaxy dependencies
40+
run: |
3041
ansible-galaxy collection install pulp.squeezer
3142
3243
- name: Linting code
@@ -39,6 +50,8 @@ jobs:
3950
# Checks-out the repository under $GITHUB_WORKSPACE, so it's accessible to the job
4051
- uses: actions/checkout@v2
4152

53+
- uses: actions/setup-python@v2
54+
4255
- name: Install dependencies
4356
run: |
4457
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)