Skip to content

Commit fbb011e

Browse files
committed
optimize tasks and workflows
disable sentinel when not needed
1 parent 052101c commit fbb011e

20 files changed

+318
-332
lines changed

.github/workflows/extended.yml

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
3+
name: redis with configurations
4+
5+
on:
6+
workflow_run:
7+
workflows:
8+
- "CI"
9+
types:
10+
- completed
11+
12+
defaults:
13+
run:
14+
working-directory: 'ansible-redis'
15+
16+
env:
17+
PY_COLORS: '1'
18+
ANSIBLE_FORCE_COLOR: '1'
19+
20+
jobs:
21+
debian:
22+
name: "${{ matrix.image }} / ansible ${{ matrix.ansible-version }} / python ${{ matrix.python }}"
23+
runs-on: ubuntu-22.04
24+
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
image:
29+
- debian:12
30+
python_version:
31+
- "3.10"
32+
- "3.11"
33+
ansible-version:
34+
- "6.7"
35+
scenario:
36+
- default
37+
38+
steps:
39+
- name: check out the codebase.
40+
uses: actions/checkout@v4
41+
with:
42+
path: 'ansible-redis'
43+
ref: ${{ github.event.workflow_run.head_branch }}
44+
45+
- name: 🐍 set up python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "${{ matrix.python_version }}"
49+
50+
- name: install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install -r test-requirements.txt
54+
55+
- name: force reinstall of community.docker
56+
run: |
57+
mkdir -p /home/runner/.ansible/collections
58+
ansible-galaxy collection install community.docker --force
59+
60+
- name: test with tox
61+
run: |
62+
make \
63+
test \
64+
-e TOX_SCENARIO="${{ matrix.scenario }}" \
65+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
66+
-e DISTRIBUTION="${{ matrix.image }}"
67+
68+
ubuntu:
69+
name: "${{ matrix.image }} / ansible ${{ matrix.ansible-version }} / python ${{ matrix.python }}"
70+
runs-on: ubuntu-22.04
71+
needs:
72+
- debian
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
image:
77+
- ubuntu:22.04
78+
- ubuntu:24.04
79+
python_version:
80+
- "3.10"
81+
- "3.11"
82+
ansible-version:
83+
- "6.7"
84+
scenario:
85+
- default
86+
87+
steps:
88+
- name: check out the codebase.
89+
uses: actions/checkout@v4
90+
with:
91+
path: 'ansible-redis'
92+
ref: ${{ github.event.workflow_run.head_branch }}
93+
94+
- name: 🐍 set up python
95+
uses: actions/setup-python@v5
96+
with:
97+
python-version: "${{ matrix.python_version }}"
98+
99+
- name: install dependencies
100+
run: |
101+
python -m pip install --upgrade pip
102+
pip install -r test-requirements.txt
103+
104+
- name: force reinstall of community.docker
105+
run: |
106+
mkdir -p /home/runner/.ansible/collections
107+
ansible-galaxy collection install community.docker --force
108+
109+
- name: test with tox
110+
run: |
111+
make \
112+
test \
113+
-e TOX_SCENARIO="${{ matrix.scenario }}" \
114+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
115+
-e DISTRIBUTION="${{ matrix.image }}"
116+
117+
scenarios:
118+
name: "${{ matrix.scenario }} / ${{ matrix.ansible-version }} / ${{ matrix.python_version }}"
119+
runs-on: ubuntu-22.04
120+
needs:
121+
- debian
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
image:
126+
- debian:12
127+
python_version:
128+
- "3.11"
129+
ansible-version:
130+
- "6.7"
131+
scenario:
132+
- redis-cluster
133+
- redis-sentinel
134+
135+
steps:
136+
- name: check out the codebase.
137+
uses: actions/checkout@v4
138+
with:
139+
path: 'ansible-redis'
140+
ref: ${{ github.event.workflow_run.head_branch }}
141+
142+
- name: 🐍 set up python
143+
uses: actions/setup-python@v5
144+
with:
145+
python-version: "${{ matrix.python_version }}"
146+
147+
- name: install dependencies
148+
run: |
149+
python -m pip install --upgrade pip
150+
pip install -r test-requirements.txt
151+
152+
- name: test with tox
153+
run: |
154+
make \
155+
test \
156+
-e TOX_SCENARIO="${{ matrix.scenario }}" \
157+
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
158+
-e DISTRIBUTION="${{ matrix.image }}"

.github/workflows/galaxy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2020
steps:
2121
- name: Check out the codebase
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
path: 'ansible-redis'
2525

.github/workflows/linter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
steps:
4343
- name: 🛎 Checkout
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@v4
4545

4646
- name: lint
4747
uses: docker://ghcr.io/github/super-linter:slim-v4

.github/workflows/main.yml

+14-58
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ defaults:
1212
run:
1313
working-directory: 'ansible-redis'
1414

15-
jobs:
15+
env:
16+
PY_COLORS: '1'
17+
ANSIBLE_FORCE_COLOR: '1'
1618

19+
jobs:
1720
arch:
18-
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
19-
runs-on: ubuntu-20.04
21+
name: "${{ matrix.image }} / ansible ${{ matrix.ansible-version }} / python ${{ matrix.python }}"
22+
runs-on: ubuntu-22.04
2023
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
2124
strategy:
2225
fail-fast: false
@@ -25,22 +28,22 @@ jobs:
2528
- archlinux:latest
2629
- artixlinux:latest
2730
python_version:
28-
- "3.10.11"
29-
- "3.11.3"
31+
- "3.10"
32+
- "3.11"
3033
ansible-version:
31-
- '6.7'
34+
- '8.5'
3235
scenario:
3336
- default
3437

3538
steps:
3639
- name: check out the codebase.
37-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
3841
with:
3942
path: 'ansible-redis'
4043
ref: ${{ github.event.workflow_run.head_branch }}
4144

4245
- name: 🐍 set up python
43-
uses: actions/setup-python@v4
46+
uses: actions/setup-python@v5
4447
with:
4548
python-version: "${{ matrix.python_version }}"
4649

@@ -49,53 +52,10 @@ jobs:
4952
python -m pip install --upgrade pip
5053
pip install -r test-requirements.txt
5154
52-
- name: test with tox
55+
- name: force reinstall of community.docker
5356
run: |
54-
make \
55-
test \
56-
-e TOX_SCENARIO="${{ matrix.scenario }}" \
57-
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
58-
-e DISTRIBUTION="${{ matrix.image }}"
59-
env:
60-
PY_COLORS: '1'
61-
ANSIBLE_FORCE_COLOR: '1'
62-
DISTRIBUTION: ${{ matrix.image }}
63-
64-
deb:
65-
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
66-
runs-on: ubuntu-20.04
67-
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
68-
strategy:
69-
fail-fast: false
70-
matrix:
71-
image:
72-
- debian:11
73-
- debian:12
74-
- ubuntu:20.04
75-
python_version:
76-
- "3.10.11"
77-
- "3.11.3"
78-
ansible-version:
79-
- "6.7"
80-
scenario:
81-
- default
82-
83-
steps:
84-
- name: check out the codebase.
85-
uses: actions/checkout@v3
86-
with:
87-
path: 'ansible-redis'
88-
ref: ${{ github.event.workflow_run.head_branch }}
89-
90-
- name: 🐍 set up python
91-
uses: actions/setup-python@v4
92-
with:
93-
python-version: "${{ matrix.python_version }}"
94-
95-
- name: install dependencies
96-
run: |
97-
python -m pip install --upgrade pip
98-
pip install -r test-requirements.txt
57+
mkdir -p /home/runner/.ansible/collections
58+
ansible-galaxy collection install community.docker --force
9959
10060
- name: test with tox
10161
run: |
@@ -104,7 +64,3 @@ jobs:
10464
-e TOX_SCENARIO="${{ matrix.scenario }}" \
10565
-e TOX_ANSIBLE="ansible_${{ matrix.ansible-version }}" \
10666
-e DISTRIBUTION="${{ matrix.image }}"
107-
env:
108-
PY_COLORS: '1'
109-
ANSIBLE_FORCE_COLOR: '1'
110-
DISTRIBUTION: ${{ matrix.image }}

.github/workflows/master-replica.yml

-106
This file was deleted.

0 commit comments

Comments
 (0)