Skip to content

common tool rustify (#28) #161

common tool rustify (#28)

common tool rustify (#28) #161

Workflow file for this run

---
name: Lint CI
"on":
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
changes:
name: Filter changes
runs-on: ubuntu-latest
outputs:
scripts: ${{ steps.filter.outputs.scripts }}
playbooks: ${{ steps.filter.outputs.playbooks }}
steps:
- name: checkout project
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
id: filter
with:
filters: |
scripts:
- '**/.local/bin/*'
playbooks:
- 'ansible/.ansible/**'
lint-shell:
name: Lint scripts
needs: changes
if: ${{ needs.changes.outputs.scripts == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Shellcheck scripts
run: |
find -- * -type f -executable -exec shellcheck {} \;
lint-playbook:
name: Lint playbooks
needs: changes
if: ${{ needs.changes.outputs.playbooks == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Setup env
run: |
python -m venv "$HOME/.venv"
{ echo "HOME=$HOME";
echo "PATH=$HOME/.venv/bin:$PATH";
echo "ansible_dwm=ansible/.ansible/dwm/";
} >> "$GITHUB_ENV"
- name: Install requirements-dev.txt
run: |
cd "$ansible_dwm"
pip install -r requirements-dev.txt
- name: Check ansible version
run: |
ansible --version
ansible-lint --version
- name: Install requirements.yml
run: |
cd "$ansible_dwm"
ansible-galaxy collection install -r requirements.yml
- name: Run yaml-lint
run: |
cd "$ansible_dwm"
yamllint .
- name: Run playbook syntax-check
run: |
cd "$ansible_dwm"
ansible-playbook --syntax-check dwm.yml
ansible-playbook --syntax-check update.yml
- name: Run ansible-lint
run: |
cd "$ansible_dwm"
ansible-lint