Skip to content

[Role][2168] support_mode role to gather all facts #3358

[Role][2168] support_mode role to gather all facts

[Role][2168] support_mode role to gather all facts #3358

name: Galaxy Importer Check
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- dev
- staging*
paths-ignore:
- '**.tar.gz'
- 'pycache/**'
- '.ansible-lint'
- 'cache/**'
- '.DS_Store'
- '.git/**'
- '.github/**'
- '.gitignore'
- '.python-version'
- '.pytest_cache/**'
- '.vscode/**'
- 'Jenkinsfile'
- 'ac'
- 'ansible.cfg'
- 'changelogs/**'
- 'collections/**'
- 'docs/**'
- 'scripts/**'
- 'test_config.yml'
- 'tests/*.ini'
- 'tests/*.py'
- 'tests/.pytest_cache'
- 'tests/pycache'
- 'tests/functional'
- 'tests/helpers'
- 'tests/requirements.txt'
- 'tests/unit'
- 'tests/sanity/ignore-*'
- 'venv*'
jobs:
galaxy-importer:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Set up venv
run: |
python -m pip install --upgrade pip
pip install virtualenv
virtualenv venv
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install ansible
pip install ansible-importer
pip install galaxy-importer
- name: Run ac-galaxy-importer
run: |
source venv/bin/activate
export FLAKE8_IGNORE=`cat ${GALAXY_IMPORTER_CONFIG} | grep -i "ignore = " | cut -d "=" -f 2 | tr -d ' '`
cp $ORIGINAL_CONSTANTS_DIR/constants.py /tmp/
sed "s/E402/$FLAKE8_IGNORE/" ${ORIGINAL_CONSTANTS_DIR}/constants.py > ${ORIGINAL_CONSTANTS_DIR}/constants.py.tmp
mv ${ORIGINAL_CONSTANTS_DIR}/constants.py.tmp ${ORIGINAL_CONSTANTS_DIR}/constants.py
rm -rf ibm-ibm_zos_core-*.tar.gz
ansible-galaxy collection build --force
python3 -m galaxy_importer.main ibm-ibm_zos_core-*.tar.gz
env:
ORIGINAL_CONSTANTS_DIR: venv/lib/python3.12/site-packages/galaxy_importer
GALAXY_IMPORTER_CONFIG: .github/workflows/galaxy-importer.cfg