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
|
2021-12-09 21:40:57 +01:00
|
|
|
- downgrade
|
2020-12-22 17:58:21 +01:00
|
|
|
- module
|
|
|
|
- plus
|
|
|
|
- source
|
2021-12-07 02:47:13 +01:00
|
|
|
- uninstall
|
|
|
|
- uninstall_plus
|
|
|
|
- upgrade
|
2020-12-22 17:58:21 +01:00
|
|
|
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-11-09 19:43:47 +01:00
|
|
|
uses: actions/checkout@v2.4.0
|
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)"
|
2022-02-07 16:40:01 +01:00
|
|
|
uses: actions/setup-python@v2.3.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 }}
|