-
Notifications
You must be signed in to change notification settings - Fork 18
111 lines (92 loc) · 3.14 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
name: CI
'on':
pull_request:
push:
branches:
- master
jobs:
test:
name: Molecule
# Workaround: systemd/kernel compatibility issue:
# Failed to parse bus message: Invalid argument
# when doing `systemctl show slurmd` by switching to an older ubuntu
# release (18.04 from 20.04). We can remove this when we are running a
# systemd version new enough to cope with the extra capabilities that are
# in newer kernel versions.
# See:
# - https://bugzilla.redhat.com/show_bug.cgi?id=190144
# - https://github.com/systemd/systemd/pull/16424
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
image:
- 'rockylinux:8.8'
scenario:
- test1
- test1b
- test1c
- test2
- test3
- test4
- test5
- test6
- test7
- test8
- test9
- test10
- test11
- test12
- test13
- test14
exclude: []
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install test dependencies.
run: |
pip3 install -U ansible molecule-podman yamllint ansible-lint
ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428
- name: Display ansible version
run: ansible --version
- name: Compensate for repo name being different to the role
run: ln -s $(pwd) ../stackhpc.openhpc
- name: Create ansible.cfg with correct roles_path
run: printf '[defaults]\nroles_path=../' >ansible.cfg
- name: Run Molecule tests.
run: molecule test -s ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_IMAGE: ${{ matrix.image }}
runonce:
name: Checks
runs-on: ubuntu-20.04
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install test dependencies.
run: |
pip3 install -U ansible molecule[podman] yamllint ansible-lint
ansible-galaxy collection install containers.podman:>=1.10.1 # otherwise get https://github.com/containers/ansible-podman-collections/issues/428
- name: Display ansible version
run: ansible --version
- name: Compensate for repo name being different to the role
run: ln -s $(pwd) ../stackhpc.openhpc
- name: Create ansible.cfg with correct roles_path
run: printf '[defaults]\nroles_path=../' >ansible.cfg
- name: Run Ansible syntax check
run: ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- name: Run Ansible lint
run: ansible-lint .
- name: Test custom filters
run: ansible-playbook tests/filter.yml -i tests/inventory -i tests/inventory-mock-groups