Merge branch 'main' into feature/crt_passphrase_check #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test Plugins | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
push: | |
branches: | |
- 'feature/**' | |
- 'fix/**' | |
- '!doc/**' | |
paths: | |
- 'plugins/**' | |
- '.github/workflows/test_plugins.yml' | |
- 'molecule/plugins/**' | |
- '.config/pep8.yml' | |
- 'tests/**' | |
pull_request: | |
branches: | |
- 'feature/**' | |
- 'fix/**' | |
- '!doc/**' | |
paths: | |
- 'plugins/**' | |
- '.github/workflows/test_plugins.yml' | |
- 'molecule/plugins/**' | |
- '.config/pep8.yml' | |
- 'tests/**' | |
jobs: | |
pep8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Set up Python 3. | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install test dependencies. | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install pep8 | |
- name: Lint code. | |
run: | | |
pep8 plugins/ --config=.config/pep8.cfg --statistics --count | |
unit-test: | |
needs: pep8 | |
runs-on: ubuntu-20.04 | |
env: | |
COLLECTION_NAMESPACE: netways | |
COLLECTION_NAME: elasticstack | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.9.14 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9.14 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install install ansible | |
- 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 `cert_info` module | |
run: | | |
python tests/unit/plugins/modules/test_cert_info.py | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
- name: Test `certs` module util | |
run: | | |
python tests/unit/plugins/module_utils/test_certs.py | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
python: | |
needs: unit-test | |
runs-on: ubuntu-20.04 | |
env: | |
COLLECTION_NAMESPACE: netways | |
COLLECTION_NAME: elasticstack | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: [ 3.5.10, 3.6.15, 3.7.13, 3.8.16, 3.10.10 ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install install ansible | |
- 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 ansible-playbook | |
run: | | |
ansible-playbook molecule/plugins/converge.yml | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
ansible-core: | |
needs: python | |
runs-on: ubuntu-20.04 | |
env: | |
COLLECTION_NAMESPACE: netways | |
COLLECTION_NAME: elasticstack | |
strategy: | |
fail-fast: false | |
matrix: | |
ansible_core_version: [ 2.11.12, 2.12.10, 2.13.8, 2.14.4 ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.9.14 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9.14 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install install ansible-core==${{ matrix.ansible_core_version }} | |
- 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 ansible-playbook | |
run: | | |
ansible-playbook molecule/plugins/converge.yml | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' | |
python-cryptography: | |
needs: ansible-core | |
runs-on: ubuntu-20.04 | |
env: | |
COLLECTION_NAMESPACE: netways | |
COLLECTION_NAME: elasticstack | |
strategy: | |
fail-fast: false | |
matrix: | |
python_cryptography_version: [ 2.5, 3.0, 3.1, 3.2, 3.3, 3.4, 35.0.0, 36.0.0, 38.0.0, 40.0.1] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.9.14 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9.14 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install install cryptography==${{ matrix.python_cryptography_version }} | |
python -m pip install install ansible | |
- 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 ansible-playbook | |
run: | | |
ansible-playbook molecule/plugins/converge.yml | |
env: | |
PY_COLORS: '1' | |
ANSIBLE_FORCE_COLOR: '1' |