feat(actions): Adds actions & lint (#1)
All checks were successful
Master branch: build & lint / build (push) Successful in 1m0s

Adds an action to perform some linting actions on ansible and the yaml files, both on push onto master and on pull requests

Reviewed-on: #1
This commit is contained in:
Thomas Maurice 2024-02-20 17:46:29 +00:00
parent 9dc88072d5
commit 93bb0b0742
18 changed files with 306 additions and 39 deletions

View file

@ -0,0 +1,28 @@
---
name: "Pull Request: build & lint"
# yamllint disable-line rule:truthy
on:
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10.13'
- name: "Creates virtual environment"
run: make venv
- name: Activate virtualenv
run: |
source venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install galaxy requirements
run: ansible-galaxy install -r requirements.yml
- name: "Run YAML linting"
run: yamllint -c .yamllint.yml .
- name: "Run Ansible linting"
run: ansible-lint

View file

@ -0,0 +1,30 @@
---
name: "Master branch: build & lint"
# yamllint disable-line rule:truthy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10.13'
- name: "Creates virtual environment"
run: make venv
- name: Activate virtualenv
run: |
source venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install galaxy requirements
run: ansible-galaxy install -r requirements.yml
- name: "Run YAML linting"
run: yamllint -c .yamllint.yml .
- name: "Run Ansible linting"
run: ansible-lint