Skip to content

cicd-tooling-github-workflow-ansible-role-molecule #444

cicd-tooling-github-workflow-ansible-role-molecule

cicd-tooling-github-workflow-ansible-role-molecule #444

---
name: cicd-tooling-github-workflow-ansible-role-molecule
on:
push:
paths:
- ".github/workflows/workflow-ansible-role-molecule.yml"
- ".github/workflows/job-00-generic-json_file.yml"
- ".github/workflows/job-00-generic-notification"
- ".github/workflows/job-40-cookiecutter-ansible-lint."
- ".github/workflows/job-40-cookiecutter-molecule-role.yml"
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
# secrets:
# SLACK_WEBHOOK:
# description: "Optional, enables Slack notifications."
# required: false
jobs:
configuration:
uses: ./.github/workflows/job-00-generic-read_json_file.yml
with:
JSON_FILE_PATH: cookiecutter.json
start:
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
with:
NOTIFICATION_EMOJI: ":vertical_traffic_light:"
NOTIFICATION_MESSAGE: "Workflow has started!"
WORKFLOW_NAME: "ansible"
markdown_links:
needs: [configuration]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-30-generic-markdown_links.yml
with:
CONFIG_FILE: ".github/config/actions/gaurav-nelson-github-action-markdown-link-check.json"
DOCUMENTATION_PATH: "{{cookiecutter.project_slug}}"
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_VERBOSE_NOTIFICATIONS }}
ansible_lint:
needs: [configuration]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-40-cookiecutter-ansible_lint.yml
with:
CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_CONCURRENCY }}
GALAXY_REQUIREMENTS_PATH: "ansible_role/requirements.yml"
PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_PYTHON_VERSIONS) }}
TARGET_PATH: "ansible_role"
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_VERBOSE_NOTIFICATIONS }}
WORKFLOW_NAME: "ansible"
molecule_test:
needs: [configuration, ansible_lint]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-40-cookiecutter-molecule_command.yml
with:
CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_CONCURRENCY }}
GALAXY_REQUIREMENTS_PATH: "ansible_role/requirements.yml"
MOLECULE_COMMAND: "test"
PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_PYTHON_VERSIONS) }}
TARGET_PATH: "ansible_role"
VERBOSE_NOTIFICATIONS: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA)._GITHUB_CI_DEFAULT_VERBOSE_NOTIFICATIONS }}
WORKFLOW_NAME: "ansible"
success:
needs: [configuration, markdown_links, molecule_test, start]
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
uses: ./.github/workflows/job-00-generic-notification.yml
with:
NOTIFICATION_EMOJI: ":checkered_flag:"
NOTIFICATION_MESSAGE: "Workflow has completed successfully!"
WORKFLOW_NAME: "ansible"