ansible-role-nginx/.github/workflows/molecule.yml

62 lines
1.8 KiB
YAML
Raw Normal View History

---
name: Molecule CI/CD
on:
pull_request:
branches:
- main
push:
branches:
- main
ignore-tags:
- "*"
schedule:
- cron: "0 0 1 * *"
jobs:
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
matrix:
scenario:
- default
- default_alpine
- default_centos
- module
- module_alpine
- module_centos
- plus
- plus_alpine
- plus_centos
- source
- source_alpine
- source_centos
steps:
- name: Check out the codebase
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
uses: actions/checkout@v2
- name: Set up Python 3
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install Molecule dependencies
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
run: |
pip3 install ansible-base==2.10.3
pip3 install ansible==2.10.3
pip3 install ansible-lint==4.3.7
pip3 install yamllint==1.25.0
pip3 install "molecule[docker]"==3.2.1
pip3 install docker==4.4.0
- name: Run Molecule tests
if: "!(contains(matrix.scenario, 'plus') && github.event.pull_request.head.repo.full_name != github.repository)"
run: molecule test -s ${{ matrix.scenario }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
NGINX_CRT: ${{ secrets.NGINX_CRT }}
NGINX_KEY: ${{ secrets.NGINX_KEY }}