Skip to content

Commit

Permalink
ci: linters and molecule tests
Browse files Browse the repository at this point in the history
  • Loading branch information
korowa authored and azat committed Jul 3, 2024
1 parent 44cf794 commit b50f9f5
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# [min, basic, moderate, safety, shared, production]
profile: basic

mock_roles:
- clickhouse
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: CI

on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- main
paths-ignore:
- "**.md"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check only *.yml extension is used
run: find . -name '*.yaml' | grep -v .pre-commit-config.yaml && exit 1 || echo OK

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
cache-dependency-path: ./requirements-test.txt

- name: Install dependencies
run: pip install -r requirements-test.txt

- name: Ansible lint
run: ansible-lint --offline --strict

molecule:
name: Molecule
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
distro:
- name: debian
version: "12"
- name: ubuntu
version: "22.04"
- name: ubuntu
version: "24.04"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
cache-dependency-path: ./requirements-test.txt

- name: Install dependencies
run: pip install -r requirements-test.txt

- name: Molecule
run: DISTRO_NAME=${{ matrix.distro.name }} DISTRO_VER=${{ matrix.distro.version }} molecule test

0 comments on commit b50f9f5

Please sign in to comment.