Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 sync with cloudalchemy/skeleton (SHA: fc18c382): ansible-lint 5+ fi…
Browse files Browse the repository at this point in the history
…xes (#13)
cloudalchemybot committed Jan 31, 2025
1 parent ab069b4 commit ed3fb3b
Showing 4 changed files with 54 additions and 27 deletions.
41 changes: 23 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,12 @@ version: 2.1

executors:
python:
docker:
- image: cimg/python:3.10
python_large:
docker:
- image: cimg/python:3.9
resource_class: large
publisher:
docker:
- image: quay.io/cloudalchemy/publisher:latest
@@ -15,35 +19,30 @@ jobs:
steps:
- checkout
- run: pip install ansible ansible-lint yamllint flake8
- run: mkdir -p .cache/roles && ln -s ../.. .cache/roles/${CIRCLE_PROJECT_REPONAME}
- run: ansible-lint
- run: ansible-lint .
- run: yamllint .
- run: flake8

test:
executor: python
executor: python_large
parameters:
ansible:
type: string
scenario:
type: string
steps:
- checkout
- setup_remote_docker
- run: ln -s ~/project ~/${CIRCLE_PROJECT_REPONAME}
- run: pip install "ansible~=<<parameters.ansible >>.0"
- run: pip install "ansible~=<< parameters.ansible >>.0"
- run: pip install -r test-requirements.txt
- run: molecule test -s default --destroy always
- run: |
if [[ -d 'molecule/alternative' ]]; then
molecule test -s alternative --destroy always
else
echo 'No alternative test'
fi
- run: |
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ -d 'molecule/latest' ]]; then
molecule test -s latest --destroy always
else
echo 'Not running latest on PR'
fi
- run:
no_output_timeout: 60m
command: |
if [[ -n "${CIRCLE_PULL_REQUEST}" ]] && [[ '<< parameters.scenario >>' == 'latest' ]]; then
echo 'Not running latest on PR'
else
molecule test -s '<< parameters.scenario >>' --destroy always
fi
release:
executor: publisher
steps:
@@ -74,6 +73,12 @@ workflows:
ansible:
- "2.9"
- "2.10"
- "4.10"
- "5.1"
scenario:
- default
- alternative
- latest
filters:
tags:
only: /.*/
33 changes: 26 additions & 7 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
---
queue_rules:
- name: default
conditions:
# These need to stay in sync with auto-maintenance/.github/settings.yml.
- "check-success=/circleci: lint"
- "check-success=/circleci: test-2.9-default"
- "check-success=/circleci: test-2.9-alternative"
- "check-success=/circleci: test-2.10-default"
- "check-success=/circleci: test-2.10-alternative"
- "check-success=/circleci: test-4.10-default"
- "check-success=/circleci: test-4.10-alternative"
- "check-success=/circleci: test-5.1-default"
- "check-success=/circleci: test-5.1-alternative"

pull_request_rules:
- name: automatic merge and new release from cloudalchemybot
conditions:
- "status-success=Travis CI - Pull Request"
- status-success=WIP
- head~=autoupdate|skeleton
- author=cloudalchemybot
# These need to stay in sync with auto-maintenance/.github/settings.yml.
- "check-success=/circleci: lint"
- "check-success=/circleci: test-2.9-default"
- "check-success=/circleci: test-2.9-alternative"
- "check-success=/circleci: test-2.10-default"
- "check-success=/circleci: test-2.10-alternative"
- "check-success=/circleci: test-4.10-default"
- "check-success=/circleci: test-4.10-alternative"
- "check-success=/circleci: test-5.1-default"
- "check-success=/circleci: test-5.1-alternative"
actions:
merge:
queue:
method: squash
strict: true
- name: delete head branch after merge
conditions: []
actions:
delete_head_branch: {}
name: default
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ You can run the different Cortex modules as separate services by setting

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`.

## Continuous Intergation
## Continuous Integration

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.

5 changes: 4 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
molecule>=3.0.0
# temporarily lock versions of molecule and ansible-compat to avoid a bug:
# https://github.com/ansible-community/ansible-compat/issues/114
ansible-compat==0.5.0
molecule==3.5.2
molecule-docker
docker
ansible-lint>=3.4.0

0 comments on commit ed3fb3b

Please sign in to comment.