blob: 5dd1c6510b1385a2f03e61f166801d23a371f877 (
plain) (
blame)
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
|
---
name: "CI"
'on': ["push", "pull_request"]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip3 install yamllint ansible-lint
- name: Copy example files
run: |
# Use example files for testing instead of encrypted files
for f in group_vars/*.example; do mv "$f" "$(echo "$f" | sed s/\.example//)"; done
for f in host_vars/*.example; do mv "$f" "$(echo "$f" | sed s/\.example//)"; done
- name: Run
run: |
yamllint .
ansible-lint
playbook:
strategy:
fail-fast: false
matrix:
molecule_distro:
- distro: archlinux
platform: "linux/amd64"
runs_on: "ubuntu-latest"
- distro: ubuntu
platform: "linux/amd64"
runs_on: "ubuntu-latest"
- distro: raspberrypi
platform: "linux/arm64/v8"
runs_on: "ubuntu-24.04-arm"
runs-on: ${{ matrix.molecule_distro.runs_on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip3 install ansible molecule molecule-plugins[docker]
- name: Remove encrypted var files
run: |
rm host_vars/*.yml
rm group_vars/*.yml
- name: Run
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
run: >-
molecule --version &&
ansible --version &&
MOLECULE_COMMAND=${{ matrix.molecule_distro.command }}
MOLECULE_PLATFORM=${{ matrix.molecule_distro.platform }}
MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }}
molecule test
|