Skip to content

CI

CI #17

Workflow file for this run

---
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
- actions
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: molecule/requirements.txt
- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-lint ansible
ansible-galaxy collection install -r requirements.yml
mkdir -p ~/.ansible/roles
ln -sfn "$GITHUB_WORKSPACE" ~/.ansible/roles/riemers.gitlab_runner
- name: Run ansible-lint
run: ansible-lint
molecule:
name: Molecule (${{ matrix.scenario }})
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
scenario:
- default
- config-update
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: molecule/requirements.txt
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install -r molecule/requirements.txt
ansible-galaxy collection install -r requirements.yml
mkdir -p ~/.ansible/roles
ln -sfn "$GITHUB_WORKSPACE" ~/.ansible/roles/riemers.gitlab_runner
- name: Verify prerequisites
run: |
ansible-galaxy collection list | grep -F ansible.posix
docker run --rm hello-world
- name: Build mock GitLab API image
run: docker build -t riemers-gitlab-runner-mock molecule/default/mock
- name: Run Molecule
run: molecule test -s ${{ matrix.scenario }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"