-
-
Notifications
You must be signed in to change notification settings - Fork 79
37 lines (32 loc) · 1.04 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: molecule lint
on:
pull_request:
push:
branches:
- master
- main
- devel*
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
ANSIBLE_ROLE: monolithprojects.github_actions_runner
SUITE: default
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
with:
path: ${{ env.ANSIBLE_ROLE }}
- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install test dependencies.
run: |
pip3 install ansible-lint yamllint
[ -f molecule/${SUITE}/requirements.yml ] && ansible-galaxy install -r molecule/${SUITE}/requirements.yml
{ echo '[defaults]'; echo 'callbacks_enabled = profile_tasks, timer'; echo 'roles_path = ../:/home/runner/.ansible/roles'; echo 'ansible_python_interpreter: /usr/bin/python3'; } >> ansible.cfg
- name: Lint code.
run: |
cd $GITHUB_WORKSPACE/$ANSIBLE_ROLE && ansible-lint --exclude molecule/ --exclude .github/