-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 1.57 KB
/
test.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
name: test
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run pre-commit hooks
uses: pre-commit/[email protected]
ansible-galaxy:
runs-on: ubuntu-22.04
needs: pre-commit
steps:
- name: Checkout release
uses: actions/checkout@v4
- name: Test Ansible Galaxy collection build
uses: artis3n/ansible_galaxy_collection@v2
with:
api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}
publish: false
molecule:
runs-on: ubuntu-22.04
needs: ansible-galaxy
strategy:
matrix:
scenario:
- default
- prometheus-exporter
- service-user-autogen-uid-gid
- service-user-explicit-uid-gid
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Setup Docker Compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: "2.24.5"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install Python packages used for testing
run: python -m pip install -r requirements.txt
env:
FORCE_COLOR: "1"
- name: Run Molecule tests
run: molecule test --scenario-name ${{ matrix.scenario }}
env:
ANSIBLE_FORCE_COLOR: "True"