Skip to content

Commit

Permalink
ci: use make for linting
Browse files Browse the repository at this point in the history
Signed-off-by: Zakhar Bessarab <[email protected]>
  • Loading branch information
zekker6 committed Feb 22, 2024
1 parent fd21c35 commit eaa856f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
name: 'Lint'
on:
pull_request: {}
push: {}
pull_request: { }
push: { }

jobs:
lint:
name: 'Lint'
runs-on: ubuntu-latest
container:
image: python:3.9-alpine
image: python:3.11-alpine
steps:
- name: 'Checkout'
uses: actions/checkout@v3

- name: Setup ansible
run: |
apk add --update --no-cache --virtual build_dependencies gcc musl-dev libffi-dev openssl-dev rust cargo
pip install --no-cache-dir ansible-core
ansible-galaxy collection install community.general
- name: 'Yamllint'
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: 'roles'
yamllint_strict: false
yamllint_comment: false

- name: Checkout
uses: actions/checkout@v3

- name: "Ansible lint playbooks"
uses: ansible/[email protected]
- name: Cache .venv directory
uses: actions/cache@v3
with:
path: "playbooks/*"
path: .venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-venv-
- name: "Ansible lint roles"
uses: ansible/[email protected]
with:
path: "roles/*"
- name: Lint
run: |
apk add --update --no-cache --virtual build_dependencies gcc musl-dev libffi-dev openssl-dev rust cargo make
make init-venv
make lint
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
init-venv:
python3 -m venv .venv
. .venv/bin/activate && pip install -r requirements.txt
. .venv/bin/activate
pip install -r requirements.txt
ansible-galaxy collection install community.general==8.3.0

venv:
. .venv/bin/activate
Expand Down

0 comments on commit eaa856f

Please sign in to comment.