2020-12-22 17:58:21 +01:00
|
|
|
---
|
|
|
|
name: Molecule CI/CD
|
2021-10-11 17:08:55 +02:00
|
|
|
"on":
|
2020-12-22 17:58:21 +01:00
|
|
|
pull_request:
|
2020-12-23 18:04:38 +01:00
|
|
|
branches:
|
|
|
|
- main
|
2020-12-22 17:58:21 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2020-12-23 18:04:38 +01:00
|
|
|
ignore-tags:
|
|
|
|
- "*"
|
2020-12-22 17:58:21 +01:00
|
|
|
schedule:
|
|
|
|
- cron: "0 0 1 * *"
|
2021-06-02 13:50:41 +02:00
|
|
|
workflow_dispatch:
|
2020-12-22 17:58:21 +01:00
|
|
|
jobs:
|
|
|
|
molecule:
|
|
|
|
name: Molecule
|
2021-01-21 14:22:04 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-12-22 17:58:21 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
scenario:
|
|
|
|
- default
|
|
|
|
- module
|
|
|
|
- plus
|
|
|
|
- source
|
|
|
|
steps:
|
|
|
|
- name: Check out the codebase
|
2021-01-08 21:19:43 +01:00
|
|
|
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
|
2021-05-24 15:01:30 +02:00
|
|
|
uses: actions/checkout@v2.3.4
|
2020-12-22 17:58:21 +01:00
|
|
|
|
|
|
|
- name: Set up Python 3
|
2021-01-08 21:19:43 +01:00
|
|
|
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
|
2021-05-17 15:38:44 +02:00
|
|
|
uses: actions/setup-python@v2.2.2
|
2020-12-22 17:58:21 +01:00
|
|
|
with:
|
2020-12-23 18:04:38 +01:00
|
|
|
python-version: 3.x
|
2020-12-22 17:58:21 +01:00
|
|
|
|
|
|
|
- name: Install Molecule dependencies
|
2021-01-08 21:19:43 +01:00
|
|
|
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
|
2021-02-09 20:33:36 +01:00
|
|
|
run: pip3 install -r .github/workflows/requirements/requirements_molecule.txt
|
|
|
|
|
|
|
|
- name: Install Ansible base dependencies
|
|
|
|
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
|
|
|
|
run: ansible-galaxy install -r .github/workflows/requirements/requirements_ansible.yml
|
2020-12-22 17:58:21 +01:00
|
|
|
|
|
|
|
- name: Run Molecule tests
|
2021-01-08 21:19:43 +01:00
|
|
|
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
|
2020-12-22 17:58:21 +01:00
|
|
|
run: molecule test -s ${{ matrix.scenario }}
|
|
|
|
env:
|
2021-10-11 17:08:33 +02:00
|
|
|
PY_COLORS: 1
|
|
|
|
ANSIBLE_FORCE_COLOR: 1
|
2020-12-22 17:58:21 +01:00
|
|
|
NGINX_CRT: ${{ secrets.NGINX_CRT }}
|
|
|
|
NGINX_KEY: ${{ secrets.NGINX_KEY }}
|