-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (72 loc) · 2.2 KB
/
code_testing.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
---
name: Code Testing
"on":
pull_request:
branches:
- master
paths-ignore:
- "*.md"
- "*version.txt"
- "maintenance/**"
- "docs/**"
- ".github/**"
- "!.github/**/*test*.yml"
- "!.github/**/*constraints*.txt"
- "!.github/**/*requirements*.txt"
- "!.github/**/*env*.txt"
# - "!.github/**/*release*.yml"
schedule:
- cron: "0 7 * * 5" # At 07:00 on Friday
jobs:
molecule_test:
strategy:
matrix:
molecule_scenario: [
alternative_installation,
check_fails,
default,
postgresql_db,
reconfigure,
upgrade
]
include:
- molecule_scenario: default
ansible_version_minimum: "4.0.0"
name: Molecule Test
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Load environment vars
id: dotenv
uses: falti/dotenv-action@v1.0.2
with:
path: .github/workflows/env_vars.txt
log-variables: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ steps.dotenv.outputs.PYTHON_SETUP_VERSION }}
- name: Upgrade pip
run: |
python3 -m pip install --constraint=.github/workflows/constraints.txt pip
python3 -m pip --version
- name: Install test dependencies
run: |
python3 -m pip install -r .github/workflows/requirements.txt -c .github/workflows/constraints.txt
molecule --version
docker --version
ansible-galaxy install --timeout 120 --verbose -r requirements.yml
ansible-galaxy collection list
- if: ${{ matrix.ansible_version_minimum }}
run: |
python3 -m pip install --force-reinstall ansible==${{ matrix.ansible_version_minimum }}
molecule --version
ansible-galaxy collection list
- name: Run Molecule tests
run: molecule test --scenario-name ${{ matrix.molecule_scenario }}
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
TEST_MOLECULE_LINT: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}