-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (91 loc) · 2.51 KB
/
molecule.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
---
name: Ansible Molecule
on: # yamllint disable-line rule:truthy
push:
tags_ignore:
- '*'
pull_request:
jobs:
setup:
name: Setup scenarios matrix
runs-on: ubuntu-22.04
outputs:
scenarios: ${{ steps.matrix.outputs.scenarios }}
steps:
- uses: actions/checkout@v4
- id: matrix
run: |
JSON="["
for s in $(find molecule -mindepth 1 -maxdepth 1 -type d -exec basename "{}" \;); do
if [ -e "molecule/${s}/molecule.yml" ]; then
JSON="${JSON}\"${s}\","
fi
done
JSON="${JSON%?}"
JSON="$JSON]"
echo "::set-output name=scenarios::$(echo $JSON)"
lint:
name: Lint
needs:
- setup
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: "${{ github.repository }}"
- name: Run ansible lint
uses: ansible/[email protected]
with:
path: "."
test:
name: Scenario "${{ matrix.scenario }}", pg-${{ matrix.postgresql_version }} on ${{ matrix.config.image }}:${{ matrix.config.tag }}
needs:
- lint
- setup
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
scenario: ${{ fromJson(needs.setup.outputs.scenarios) }}
postgresql_version:
- 16
config:
- name: rocky8
image: "rockylinux"
tag: "8.9"
- name: rocky9
image: "rockylinux"
tag: "9.3"
- name: debian11
image: "debian"
tag: "11"
- name: debian12
image: "debian"
tag: "12"
- name: ubuntu20
image: "ubuntu"
tag: "20.04"
- name: ubuntu22
image: "ubuntu"
tag: "22.04"
- name: ubuntu24
image: "ubuntu"
tag: "24.04"
steps:
- name: checkout
uses: actions/checkout@v4
with:
path: "${{ github.repository }}"
- name: molecule
uses: gofrolist/[email protected]
with:
# molecule_options: --debug
molecule_command: test
molecule_args: --scenario-name ${{ matrix.scenario }} -d docker
molecule_working_dir: "${{ github.repository }}"
env:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}
name: ${{ matrix.config.name }}
postgresql_version: ${{ matrix.postgresql_version }}