Skip to content

Refactoring molecule scenarios and GitHub workflows #209

Refactoring molecule scenarios and GitHub workflows

Refactoring molecule scenarios and GitHub workflows #209

---
name: Test Role Kibana
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
pull_request:
paths:
- 'roles/kibana/**'
- '.github/workflows/test_role_kibana.yml'
- 'molecule/kibana_**'
jobs:
lint_kibana:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/test_linting.yml
with:
rolename: kibana
molecule_kibana:
needs: lint_kibana
runs-on: ubuntu-latest
env:
COLLECTION_NAMESPACE: netways
COLLECTION_NAME: elasticstack
strategy:
fail-fast: false
matrix:
distro:
- debian13
scenario:
- kibana_default
release:
- 8
ansible_version:
- "ansible-core>=2.19,<2.20" #Correspond ansible>=12.0,<13.0
python_version:
- "3.11"
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "${{ matrix.ansible_version }}"
python3 -m pip install -r requirements-test.txt
- name: Install collection
run: |
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
- name: Test with molecule
run: |
ansible --version
molecule --version
molecule test -s ${{ matrix.scenario }}
env:
MOLECULE_DISTRO: ${{ matrix.distro }}
ELASTIC_RELEASE: ${{ matrix.release }}
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'