-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.76 KB
/
molecule.yaml
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
# https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml
# README FIRST
# 1. replace "NAMESPACE" and "COLLECTION_NAME" with the correct name in the env section (e.g. with 'community' and 'mycollection')
# 2. If you don't have unit tests remove that section
# 3. If your collection depends on other collections ensure they are installed, see "Install collection dependencies"
# If you need help please ask in #ansible-community on the Libera.chat IRC network
name: Molecule Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'roles/**'
push:
branches:
- devel
paths:
- 'roles/**'
env:
NAMESPACE: thorian93
COLLECTION_NAME: main
jobs:
build:
runs-on: ubuntu-20.04
name: Run Molecule
strategy:
fail-fast: false
matrix:
role:
- certmanage
- common
- journald
- logrotate
- ntp
- proxy
- ssh
- sudo
- upgrade
- webserver
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}
- name: Test with molecule
run: |
cd roles/${{ matrix.role }}
molecule test
working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}