-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (76 loc) · 2.31 KB
/
ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: CI
on:
pull_request:
push:
branches:
- main
schedule:
# Sunday 04:30 UTC
- cron: "30 4 * * 0"
workflow_dispatch:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install linting dependencies
run: pip3 install yamllint ansible ansible-lint
- name: Install Galaxy dependencies
run: ansible-galaxy install -r requirements.yml
- name: lint code
run: |
yamllint .
ansible-lint
integration:
name: Integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-13
- macos-12
steps:
- name: Check out the code
uses: actions/checkout@v3
- name: Find Github built-in Python links
run: |
brew unlink --dry-run python > /tmp/python-links.txt
- name: Remove Github runner's built-in Python
run: |
sudo rm -rf /Library/Frameworks/Python.framework
sudo rm -rf "/Applications/Python 2.7"
cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework' | awk '{print $9}' | tr -d @ | xargs rm -f
- name: Uninstall GitHub runner's built-in Homebrew
run: tests/uninstall-homebrew.sh
- name: Uninstall GitHub runner's built-in browser installs
run: |
sudo rm -rf /Applications/Firefox.app
sudo rm -rf /Applications/Google\ Chrome.app
- name: Unlink Github Action's built-in Python
run: |
cat /tmp/python-links.txt | xargs -J % -n1 sudo rm -f %
- name: Run bootstrap shell script
run: |
pwd -P
ls -lah
./bootstrap.sh
- name: Set up the Ansible test environment
run: |
cp tests/ansible.cfg ./
cp tests/inventory ./
cp tests/config.yml ./
ansible-galaxy install -r requirements.yml
- name: Test playbook syntax
run: ansible-playbook main.yml --syntax-check
- name: Test playbook
run: ansible-playbook main.yml --extra-vars "sshkey_passphrase=TEST"
env:
ANSIBLE_FORCE_COLOR: '1'