ansible-generator/templates/molecule-action.yml.j2

57 lines
1.4 KiB
Django/Jinja

---
{{ ansible_managed | comment }}
name: Ansible Molecule
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '{{ letter_minute_mapping[role_name[0]] }} {{ letter_hour_mapping[role_name[0]] }} {{ letter_day_mapping[role_name[0]] }} * *'
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: ansible-lint
uses: ansible-community/ansible-lint-action@main
test:
needs:
- lint
runs-on: ubuntu-20.04
strategy:
fail-fast: no
matrix:
config:
{% for platform in meta.galaxy_info.platforms %}
{% for version in platform.versions %}
{% for tag in distribution_version_mapping[platform.name][version] %}
- image: "{{ platform_image_mapping[platform.name] }}"
tag: "{{ tag }}"
{% endfor %}
{% endfor %}
{% endfor %}
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: {% raw %}"${{ github.repository }}"{% endraw %}
- name: molecule
uses: {{ molecule_action }}
with:
image: {% raw %}${{ matrix.config.image }}{% endraw %}
tag: {% raw %}${{ matrix.config.tag }}{% endraw %}
{% if github_variables_mapping is defined %}
env:
{% for item in github_variables_mapping %}
{{ item.variable }}: {% raw %}${{ {%endraw %}{{ item.name }} {% raw %}}}{% endraw %}
{% endfor %}
{% endif %}