Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SET-771 Implementing the CI fix #250

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 8 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,34 @@ jobs:
name: molecule
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.11']

steps:
- name: Checkout the codebase.
uses: actions/checkout@v2

- name: Set up Python3.
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: ${{ matrix.python_version }}

- name: Install testing dependencies.
run: |
python -m pip install --upgrade pip
pip install yamllint 'molecule>=4.0.4' 'molecule-plugins[podman]>=23.0.0' ansible-core flake8 ansible-lint voluptuous
pip install yamllint 'molecule>=6.0.3' 'molecule-plugins[podman]>=23.0.0' 'ansible-core<2.16' flake8 ansible-lint voluptuous
ansible-galaxy collection install -r requirements.yml

- name: Run linter
run: |
ansible-lint --version
ansible-lint -v

- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: 'pip'

- name: Install ansible and molecule
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
command: |
python -m pip install --upgrade pip
pip install --progress-bar off 'molecule>=5.0.1' 'molecule-plugins[docker]>=23.0.0' ansible-core==${{ matrix.ansible_version }}
if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.txt ]; then
echo "=== Installing python deps"
pip install --progress-bar off -r ansible_collections/${{ inputs.fqcn }}/requirements.txt
fi
if [ -f ansible_collections/${{ inputs.fqcn }}/requirements.yml ]; then
echo "=== Installing dependencies"
ansible-galaxy collection install -r ansible_collections/${{ inputs.fqcn }}/requirements.yml -p /home/runner/.ansible/collections --force-with-deps
fi
if [ -f ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml ]; then
echo "=== Installing test dependencies"
ansible-galaxy role install -r ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml ||:
ansible-galaxy collection install -r ansible_collections/${{ inputs.fqcn }}/molecule/requirements.yml -p /home/runner/.ansible/collections
fi
exit 0

- name: "Run molecule tests"
run: molecule test --all
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: rhel-8
MOLECULE_DISTRO: rhel-9
working-directory: '.'
5 changes: 0 additions & 5 deletions molecule/account/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ platforms:
- sudo
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: auto_silent
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
converge: converge.yml
Expand Down
5 changes: 0 additions & 5 deletions molecule/cron/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ platforms:
- sudo
provisioner:
name: ansible
config_options:
defaults:
interpreter_python: auto_silent
ssh_connection:
pipelining: false
playbooks:
converge: converge.yml
verify: verify.yml
Expand Down
Loading