Skip to content

Commit

Permalink
Add linting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tbauriedel committed Dec 28, 2023
1 parent e254430 commit 8ae982e
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Lint

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4

- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install test dependencies.
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt
- name: yamllint
run: |
yamllint .
- name: ansible-lint
run: |
ansible-lint .
5 changes: 5 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
extends: relaxed

rules:
line-length: disable
2 changes: 2 additions & 0 deletions ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
skip_list:
- var-naming[no-role-prefix] # remove when https://github.com/ansible/ansible-lint/discussions/3451 is done
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ansible
ansible-lint
8 changes: 4 additions & 4 deletions roles/repos/tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: apt - Add repositiory key
- name: Apt - Add repositiory key
ansible.builtin.apt_key:
state: present
url: "{{ influxdb_repos_key_url }}"

- name: apt - Add repository to list
ansible.builtin.apt_repository:
repo: "{{ influxdb_repos_stable }}"
- name: Apt - Add repository to list
ansible.builtin.apt_repository:
repo: "{{ influxdb_repos_stable }}"
state: present
4 changes: 2 additions & 2 deletions roles/repos/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: yum - Add repositiory key
- name: Yum - Add repositiory key
ansible.builtin.rpm_key:
state: present
key: "{{ influxdb_repos_key_url }}"

- name: yum - Add repository to list
- name: Yum - Add repository to list
ansible.builtin.yum_repository:
state: present
name: influxdb
Expand Down
2 changes: 1 addition & 1 deletion roles/repos/vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
influxdb_repos_stable: "deb https://repos.influxdata.com/{{ ansible_distribution|lower }} {{ ansible_distribution_release|lower }} stable"
influxdb_repos_stable: "deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} stable"
2 changes: 1 addition & 1 deletion roles/repos/vars/default.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
# default variables for influxdb.repos
# default variables for influxdb.repos
2 changes: 1 addition & 1 deletion vagrant-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
become: true

roles:
- repos
- repos

0 comments on commit 8ae982e

Please sign in to comment.