Semptember ansible updates #23
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: Molecule Run Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
hadolint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# https://github.com/marketplace/actions/hadolint-action | |
- name: Linting main Dockerfile | |
uses: hadolint/[email protected] | |
with: | |
recursive: true | |
dockerfile: Dockerfile | |
ignore: "DL3008" | |
molecule: | |
runs-on: ubuntu-latest | |
needs: hadolint | |
outputs: | |
docker-jenkins: ${{ steps.molecule.outputs.docker-jenkins }} | |
docker-jenkins-agent: ${{ steps.molecule.outputs.docker-jenkins-agent }} | |
manual-jenkins: ${{ steps.molecule.outputs.manual-jenkins }} | |
manual-jenkins-agent: ${{ steps.molecule.outputs.manual-jenkins-agent }} | |
system-docker: ${{ steps.molecule.outputs.system-docker }} | |
system-nginx: ${{ steps.molecule.outputs.system-nginx }} | |
system-prepare: ${{ steps.molecule.outputs.system-prepare }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# https://github.com/marketplace/actions/paths-changes-filter | |
- uses: dorny/paths-filter@v2 | |
id: molecule | |
with: | |
filters: | | |
docker-jenkins: | |
- 'ansible/roles/docker-jenkins/**' | |
docker-jenkins-agent: | |
- 'ansible/roles/docker-jenkins-agent/**' | |
manual-jenkins: | |
- 'ansible/roles/manual-jenkins/**' | |
manual-jenkins-agent: | |
- 'ansible/roles/manual-jenkins-agent/**' | |
system-docker: | |
- 'ansible/roles/system-docker/**' | |
system-nginx: | |
- 'ansible/roles/system-nginx/**' | |
system-prepare: | |
- 'ansible/roles/system-prepare/**' | |
docker-jenkins: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.docker-jenkins == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
docker-jenkins-matrix: | |
needs: docker-jenkins | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
OS_FAMILY: [docker-suse, docker-redhat, docker-debian, docker-ubuntu] | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Linting main Dockerfile | |
uses: hadolint/[email protected] | |
with: | |
recursive: true | |
dockerfile: ./ansible/roles/docker-jenkins/files/Dockerfile | |
ignore: "DL3008" | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
# https://github.com/marketplace/actions/free-disk-space-ubuntu | |
- name: Pre-cleaning system before molecule tests | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
- name: Run molecule tests when content changes in docker-jenkins role | |
env: | |
MOLECULE_PROFILE: ${{ matrix.OS_FAMILY }} | |
run: | | |
molecule --version | |
molecule test -s $MOLECULE_PROFILE | |
working-directory: ansible/roles/docker-jenkins | |
docker-jenkins-agent: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.docker-jenkins-agent == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
docker-jenkins-agent-matrix: | |
needs: docker-jenkins-agent | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
OS_FAMILY: [docker-suse, docker-redhat, docker-debian] | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Pre-cleaning system before molecule tests | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
- name: Run molecule tests when content changes in docker-jenkins-agent role | |
env: | |
MOLECULE_PROFILE: ${{ matrix.OS_FAMILY }} | |
run: | | |
molecule --version | |
molecule test -s $MOLECULE_PROFILE | |
working-directory: ansible/roles/docker-jenkins-agent | |
manual-jenkins: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.manual-jenkins == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
manual-jenkins-matrix: | |
needs: manual-jenkins | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
OS_FAMILY: [docker-suse, docker-redhat, docker-debian, docker-ubuntu] | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Run molecule tests when content changes in manual-jenkins role | |
env: | |
MOLECULE_PROFILE: ${{ matrix.OS_FAMILY }} | |
run: | | |
molecule --version | |
molecule test -s $MOLECULE_PROFILE | |
working-directory: ansible/roles/manual-jenkins | |
manual-jenkins-agent: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.manual-jenkins-agent == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
manual-jenkins-agent-matrix: | |
needs: manual-jenkins-agent | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
OS_FAMILY: [docker-suse, docker-redhat, docker-debian] | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Run molecule tests when content changes in manual-jenkins-agent role | |
env: | |
MOLECULE_PROFILE: ${{ matrix.OS_FAMILY }} | |
run: | | |
molecule --version | |
molecule test -s $MOLECULE_PROFILE | |
working-directory: ansible/roles/manual-jenkins-agent | |
system-docker: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.system-docker == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Run molecule tests when content changes in system-docker role | |
run: | | |
molecule --version | |
molecule test | |
working-directory: ansible/roles/system-docker | |
system-nginx: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.system-nginx == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Run molecule tests when content changes in system-nginx role | |
run: | | |
molecule --version | |
molecule test | |
working-directory: ansible/roles/system-nginx | |
system-prepare: | |
needs: molecule | |
if: ${{ needs.molecule.outputs.system-prepare == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
PY_COLORS: 1 | |
ANSIBLE_FORCE_COLOR: 1 | |
ANSIBLE_STDOUT_CALLBACK: yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install -r requirements.txt | |
- name: Run molecule tests when content changes in system-prepare role | |
run: | | |
molecule --version | |
molecule test | |
working-directory: ansible/roles/system-prepare |