Skip to content

Commit f6d3835

Browse files
🤖 sync with cloudalchemy/skeleton (SHA: fc18c382): ansible-lint 5+ fixes (#13)
1 parent ab069b4 commit f6d3835

File tree

4 files changed

+54
-27
lines changed

4 files changed

+54
-27
lines changed

.circleci/config.yml

+23-18
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ version: 2.1
33

44
executors:
55
python:
6+
docker:
7+
- image: cimg/python:3.10
8+
python_large:
69
docker:
710
- image: cimg/python:3.9
11+
resource_class: large
812
publisher:
913
docker:
1014
- image: quay.io/cloudalchemy/publisher:latest
@@ -15,35 +19,30 @@ jobs:
1519
steps:
1620
- checkout
1721
- run: pip install ansible ansible-lint yamllint flake8
18-
- run: mkdir -p .cache/roles && ln -s ../.. .cache/roles/${CIRCLE_PROJECT_REPONAME}
19-
- run: ansible-lint
22+
- run: ansible-lint .
2023
- run: yamllint .
2124
- run: flake8
2225

2326
test:
24-
executor: python
27+
executor: python_large
2528
parameters:
2629
ansible:
2730
type: string
31+
scenario:
32+
type: string
2833
steps:
2934
- checkout
3035
- setup_remote_docker
31-
- run: ln -s ~/project ~/${CIRCLE_PROJECT_REPONAME}
32-
- run: pip install "ansible~=<<parameters.ansible >>.0"
36+
- run: pip install "ansible~=<< parameters.ansible >>.0"
3337
- run: pip install -r test-requirements.txt
34-
- run: molecule test -s default --destroy always
35-
- run: |
36-
if [[ -d 'molecule/alternative' ]]; then
37-
molecule test -s alternative --destroy always
38-
else
39-
echo 'No alternative test'
40-
fi
41-
- run: |
42-
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ -d 'molecule/latest' ]]; then
43-
molecule test -s latest --destroy always
44-
else
45-
echo 'Not running latest on PR'
46-
fi
38+
- run:
39+
no_output_timeout: 60m
40+
command: |
41+
if [[ -n "${CIRCLE_PULL_REQUEST}" ]] && [[ '<< parameters.scenario >>' == 'latest' ]]; then
42+
echo 'Not running latest on PR'
43+
else
44+
molecule test -s '<< parameters.scenario >>' --destroy always
45+
fi
4746
release:
4847
executor: publisher
4948
steps:
@@ -74,6 +73,12 @@ workflows:
7473
ansible:
7574
- "2.9"
7675
- "2.10"
76+
- "4.10"
77+
- "5.1"
78+
scenario:
79+
- default
80+
- alternative
81+
- latest
7782
filters:
7883
tags:
7984
only: /.*/

.mergify.yml

+26-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
---
2+
queue_rules:
3+
- name: default
4+
conditions:
5+
# These need to stay in sync with auto-maintenance/.github/settings.yml.
6+
- "check-success=/circleci: lint"
7+
- "check-success=/circleci: test-2.9-default"
8+
- "check-success=/circleci: test-2.9-alternative"
9+
- "check-success=/circleci: test-2.10-default"
10+
- "check-success=/circleci: test-2.10-alternative"
11+
- "check-success=/circleci: test-4.10-default"
12+
- "check-success=/circleci: test-4.10-alternative"
13+
- "check-success=/circleci: test-5.1-default"
14+
- "check-success=/circleci: test-5.1-alternative"
15+
216
pull_request_rules:
317
- name: automatic merge and new release from cloudalchemybot
418
conditions:
5-
- "status-success=Travis CI - Pull Request"
619
- status-success=WIP
720
- head~=autoupdate|skeleton
821
- author=cloudalchemybot
22+
# These need to stay in sync with auto-maintenance/.github/settings.yml.
23+
- "check-success=/circleci: lint"
24+
- "check-success=/circleci: test-2.9-default"
25+
- "check-success=/circleci: test-2.9-alternative"
26+
- "check-success=/circleci: test-2.10-default"
27+
- "check-success=/circleci: test-2.10-alternative"
28+
- "check-success=/circleci: test-4.10-default"
29+
- "check-success=/circleci: test-4.10-alternative"
30+
- "check-success=/circleci: test-5.1-default"
31+
- "check-success=/circleci: test-5.1-alternative"
932
actions:
10-
merge:
33+
queue:
1134
method: squash
12-
strict: true
13-
- name: delete head branch after merge
14-
conditions: []
15-
actions:
16-
delete_head_branch: {}
35+
name: default

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ You can run the different Cortex modules as separate services by setting
107107

108108
The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/ansible-community/molecule) (v3.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. Running your tests is as simple as executing `molecule test`.
109109

110-
## Continuous Intergation
110+
## Continuous Integration
111111

112112
Combining molecule and circle CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which can take more time than local testing, so please be patient.
113113

test-requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
molecule>=3.0.0
1+
# temporarily lock versions of molecule and ansible-compat to avoid a bug:
2+
# https://github.com/ansible-community/ansible-compat/issues/114
3+
ansible-compat==0.5.0
4+
molecule==3.5.2
25
molecule-docker
36
docker
47
ansible-lint>=3.4.0

0 commit comments

Comments
 (0)