-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (60 loc) · 1.86 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
64
65
66
67
68
69
70
---
name: Run tests
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "17 5 * * 2"
jobs:
molecule:
name: Molecule test
runs-on: ubuntu-latest
strategy:
matrix:
distro:
- ubuntu:22.04
- ubuntu:20.04
ansible:
- ansible
- ansible==2.9.*
postgresql:
- 13
- 14
- 15
env:
WORKDIR: ${{ matrix.ansible == 'ansible==2.9.*' && 'giner.barman' }}
defaults:
run:
working-directory: ${{ env.WORKDIR }} # https://github.com/ansible-community/molecule/pull/3409
steps:
- name: Check out
uses: actions/checkout@v3
with:
path: ${{ env.WORKDIR }} # https://github.com/ansible-community/molecule/pull/3409
- name: Set up Python 3
if: matrix.ansible != 'ansible==2.9.*'
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Set up Python 3 for Ansible 2.9
if: matrix.ansible == 'ansible==2.9.*'
uses: actions/setup-python@v4
with:
python-version: '3.8.x'
- name: Install test dependencies
if: matrix.ansible != 'ansible==2.9.*'
run: python3 -m pip install "${{ matrix.ansible }}" -Ur requirements-molecule.txt
- name: Install test dependencies for Ansible 2.9
if: matrix.ansible == 'ansible==2.9.*'
run: |
python3 -m pip install "${{ matrix.ansible }}" -Ur requirements-molecule-ansible-2.9.txt
ansible-galaxy collection install community.general community.docker community.postgresql
- name: Run Molecule tests
run: molecule test --all
env:
PY_COLORS: '1' # for molecule
ANSIBLE_FORCE_COLOR: 'True'
MOLECULE_DISTRO: '${{ matrix.distro }}'
POSTGRESQL_VERSION: '${{ matrix.postgresql }}'