Skip to content

Merge pull request #91 from schmaxit/main #434

Merge pull request #91 from schmaxit/main

Merge pull request #91 from schmaxit/main #434

Workflow file for this run

---
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 6 * * *'
env:
COLORTERM: 'yes'
TERM: 'xterm-256color'
PYTEST_ADDOPTS: '--color=yes'
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.11"]
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/middleware_automation/keycloak
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
cache: 'pip'
- name: Install yamllint, ansible and molecule
run: |
python -m pip install --upgrade pip
pip install yamllint 'molecule>=4.0.4' 'molecule-plugins[docker]>=23.0.0' ansible-core flake8 ansible-lint voluptuous
if [ -f ansible_collections/middleware_automation/keycloak/requirements.txt ]; then
pip install -r ansible_collections/middleware_automation/keycloak/requirements.txt
fi
if [ -f ansible_collections/middleware_automation/keycloak/requirements.yml ]; then
ansible-galaxy collection install -r ansible_collections/middleware_automation/keycloak/requirements.yml -p /home/runner/.ansible/collections --force-with-deps
fi
if [ -f ansible_collections/middleware_automation/keycloak/molecule/requirements.yml ]; then
ansible-galaxy collection install -r ansible_collections/middleware_automation/keycloak/molecule/requirements.yml -p /home/runner/.ansible/collections
fi
- name: Create default collection path
run: |
mkdir -p /home/runner/.ansible/
ln -s /home/runner/work/keycloak/keycloak /home/runner/.ansible/collections
- name: Install ansible-lint custom rules
uses: actions/checkout@v2
with:
repository: ansible-middleware/ansible-lint-custom-rules
path: ansible_collections/ansible-lint-custom-rules/
- name: Run linter
run: |
ansible-lint --version
ansible-lint -v
working-directory: ./ansible_collections/middleware_automation/keycloak
- name: Run sanity tests
run: ansible-test sanity -v --color --python ${{ matrix.python_version }} --exclude changelogs/fragments/.gitignore --skip-test symlinks
working-directory: ./ansible_collections/middleware_automation/keycloak
- name: Run molecule test
run: molecule test --all
working-directory: ./ansible_collections/middleware_automation/keycloak
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'