-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.49 KB
/
ansible_tests.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ] # Add more versions here if necessary.
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements*.txt'
- name: Install dependencies and run linters
run: |
export PIP_NO_CLEAN=TRUE
export PIP_PREFER_BINARY=TRUE
python -m pip install --upgrade pip setuptools wheel
if [ -f requirements-dev.txt ]; then
python -m pip install -r requirements-dev.txt
elif [ -f requirements.txt ]; then
python -m pip install -r requirements.txt
fi
if [ -f requirements.yaml ]; then ansible-galaxy install -r requirements.yaml -p ./ext_roles; fi
# Set up ansible vault
echo $ANSIBLE_VAULT_PASSWORD > .vault_pass
chmod 600 .vault_pass
export ANSIBLE_VAULT_PASSWORD_FILE=.vault_pass
# Run all commands within "ansible" directory
inv syntaxcheck
inv ansiblelint
inv yamllint
inv flake8
inv black
inv ansiblelater
env:
ANSIBLE_VAULT_PASSWORD: ${{ secrets.VAULT_PASS }}
...