Skip to content

Commit

Permalink
init ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenion1987 committed Sep 24, 2024
1 parent 2ebc025 commit 9bcee8a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI Pipeline

on:
push:
branches:
- "!main"
pull_request:
branches:
- main

jobs:
ansible-lint:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install pre-commit
run: |
sudo apt update && sudo apt -y install git
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

ansible-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Ansible
run: pip install 'ansible>=3.0.0'

- name: Run Ansible Playbook
run: ansible-playbook tests/test.yml
14 changes: 12 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
stages:
- test

test:
before_script:
- apt update && apt -y install git

ansible-lint:
stage: test
image: python:slim-bookworm
script:
- python -m pip install pre-commit
- pre-commit run --all-files

ansible-test:
stage: test
image: python:slim-bookworm
script:
- python -m pip install 'ansible>=9.0.0,<=10.0.0'
- python -m pip install 'ansible>=3.0.0'
- ansible-playbook tests/test.yml
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
name: Cleanup trailing whitespaces
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/ansible-community/ansible-lint
rev: v24.9.2
hooks:
- id: ansible-lint
name: Check Ansible files
args: ["--exclude", ".git/"]

0 comments on commit 9bcee8a

Please sign in to comment.