mirror of
https://github.com/ansible/awx.git
synced 2026-10-31 14:36:17 -02:30
Common setup-python in github action (#15901)
This commit is contained in:
@@ -11,9 +11,7 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Get python version from Makefile
|
- uses: ./.github/actions/setup-python
|
||||||
shell: bash
|
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set lower case owner name
|
- name: Set lower case owner name
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: 'Setup Python from Makefile'
|
||||||
|
description: 'Extract and set up Python version from Makefile'
|
||||||
|
inputs:
|
||||||
|
python-version:
|
||||||
|
description: 'Override Python version (optional)'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
working-directory:
|
||||||
|
description: 'Directory containing the Makefile'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Get python version from Makefile
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ inputs.python-version }}" ]; then
|
||||||
|
echo "py_version=${{ inputs.python-version }}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
cd ${{ inputs.working-directory }}
|
||||||
|
echo "py_version=`make PYTHON_VERSION`" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
- name: Install python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.py_version }}
|
||||||
@@ -130,7 +130,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
@@ -172,14 +172,9 @@ jobs:
|
|||||||
repository: ansible/awx-operator
|
repository: ansible/awx-operator
|
||||||
path: awx-operator
|
path: awx-operator
|
||||||
|
|
||||||
- name: Get python version from Makefile
|
- uses: ./awx/.github/actions/setup-python
|
||||||
working-directory: awx
|
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install python ${{ env.py_version }}
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.py_version }}
|
working-directory: awx
|
||||||
|
|
||||||
- name: Install playbook dependencies
|
- name: Install playbook dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -283,7 +278,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
@@ -359,7 +354,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
|||||||
@@ -49,14 +49,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV
|
echo "DEV_DOCKER_TAG_BASE=ghcr.io/${OWNER,,}" >> $GITHUB_ENV
|
||||||
echo "COMPOSE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
echo "COMPOSE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||||
echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
env:
|
env:
|
||||||
OWNER: '${{ github.repository_owner }}'
|
OWNER: '${{ github.repository_owner }}'
|
||||||
|
|
||||||
- name: Install python ${{ env.py_version }}
|
- uses: ./.github/actions/setup-python
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.py_version }}
|
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: ./.github/actions/setup-python
|
||||||
|
|
||||||
- name: Install python requests
|
- name: Install python requests
|
||||||
run: pip install requests
|
run: pip install requests
|
||||||
|
|
||||||
- name: Check if user is a member of Ansible org
|
- name: Check if user is a member of Ansible org
|
||||||
uses: jannekem/run-python-script-action@v1
|
uses: jannekem/run-python-script-action@v1
|
||||||
id: check_user
|
id: check_user
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- name: Get python version from Makefile
|
- uses: ./.github/actions/setup-python
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install python ${{ env.py_version }}
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.py_version }}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -64,14 +64,9 @@ jobs:
|
|||||||
repository: ansible/awx-logos
|
repository: ansible/awx-logos
|
||||||
path: awx-logos
|
path: awx-logos
|
||||||
|
|
||||||
- name: Get python version from Makefile
|
- uses: ./awx/.github/actions/setup-python
|
||||||
working-directory: awx
|
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install python ${{ env.py_version }}
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.py_version }}
|
working-directory: awx
|
||||||
|
|
||||||
- name: Install playbook dependencies
|
- name: Install playbook dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -23,13 +23,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
|
||||||
- name: Get python version from Makefile
|
- uses: ./.github/actions/setup-python
|
||||||
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Install python ${{ env.py_version }}
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: ${{ env.py_version }}
|
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user