CI #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 6 * * *' | |
env: | |
COLORTERM: 'yes' | |
TERM: 'xterm-256color' | |
PYTEST_ADDOPTS: '--color=yes' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: | |
- "3.10" | |
ansible: | |
- stable-2.12 | |
- stable-2.13 | |
- stable-2.14 | |
- stable-2.15 | |
- devel | |
include: | |
- python: "3.8" | |
ansible: "stable-2.12" | |
- python: "3.9" | |
ansible: "stable-2.13" | |
- python: "3.11" | |
ansible: "devel" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install libyaml-dev for PyYAML | |
run: sudo apt-get install -y libyaml-dev | |
- name: Install Ansible | |
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz | |
- name: Install dependencies | |
run: make test-setup | |
- name: Run sanity tests | |
run: make SANITY_OPTS="--local" sanity | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install dependencies | |
run: make doc-setup | |
- name: Build docs | |
run: make doc | |
- name: Upload docs artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs-html | |
path: docs/_build/html/ | |
galaxy-importer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install dependencies | |
run: pip install --upgrade py galaxy-importer | |
- name: Run galaxy-importer | |
run: make galaxy-importer | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install dependencies | |
run: | | |
pip install --upgrade ansible-core | |
pip install --upgrade -r requirements-lint.txt | |
- name: Install required collections for linting | |
run: ansible-galaxy collection install theforeman.operations | |
- name: Run lint | |
run: make lint | |
- name: Upload collection artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: collection | |
path: redhat-satellite_operations-*.tar.gz | |
molecule: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python: | |
- "3.10" | |
ansible: | |
- stable-2.12 | |
- stable-2.13 | |
- stable-2.14 | |
- stable-2.15 | |
- devel | |
include: | |
- python: "3.8" | |
ansible: "stable-2.9" | |
- python: "3.8" | |
ansible: "stable-2.10" | |
- python: "3.9" | |
ansible: "stable-2.11" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install Ansible | |
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz | |
- name: Install dependencies | |
run: make test-setup | |
- name: Install Ansible 2.9 compatible molecule | |
run: pip install --upgrade 'molecule[docker,lint]<4.0' | |
if: matrix.ansible == 'stable-2.9' | |
- name: Run tests | |
env: | |
DRIVER_NAME: docker | |
run: ./tests/molecule.sh | |
execution_environment: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install dependencies | |
run: pip install --upgrade ansible-core ansible-builder ansible-navigator | |
- name: Build EE | |
run: ansible-builder build -v 3 -t test-ee:latest -f meta/execution-environment.yml |