Skip to content

CI

CI #2538

Workflow file for this run

name: CI
on:
pull_request:
schedule:
- cron: "0 3 * * *"
env:
setup_cassandra_version_file: "./tests/integration/targets/setup_cassandra/defaults/main.yml"
setup_ccm_version_file: "./tests/integration/targets/setup_cassandra_cluster_manager/defaults/main.yml"
jobs:
sanity:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ansible_collections/community/cassandra
strategy:
matrix:
versions:
- python_version: "3.10"
ansible_version: "stable-2.15"
- python_version: "3.10"
ansible_version: "stable-2.16"
- python_version: "3.11"
ansible_version: "devel"
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/community/cassandra
- name: Set up Python ${{ matrix.versions.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.python_version }}
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
- name: Run sanity tests
run: ansible-test sanity --docker -v --color --python 3.9
integration_matrix:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ansible_collections/community/cassandra
outputs:
matrix: ${{ steps.json-list.outputs.modules-to-test }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/community/cassandra
- name: Generate module list
run: |
find tests/integration/targets -type d -maxdepth 1 -not -name 'setup*' | cut -d '/' -f4 | sort | awk NF | jq -sRc 'split("\n") | map(select(length > 0))' > int_test_modules.json
- name: Set output variable
id: json-list
run: |
output=$(cat int_test_modules.json)
echo "modules-to-test=$output" >> $GITHUB_OUTPUT
echo "$output"
integration_311x:
needs: integration_matrix
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ansible_collections/community/cassandra
strategy:
matrix:
versions:
- python_version: "3.10"
ansible_version: "stable-2.15"
- python_version: "3.10"
ansible_version: "stable-2.16"
- python_version: "3.11"
ansible_version: "devel"
cassandra_version:
- package_version: "311x"
tar_version: "3.11.11"
test_scenario:
- docker_image: "ubuntu2204"
python_version: "3.10"
ansible_test_options: ""
#- docker_image: centos7
# python_version: "2.7"
# ansible_test_options: "--docker-privileged"
cassandra_module: ${{ fromJson(needs.integration_matrix.outputs.matrix) }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/community/cassandra
- name: Set up Python ${{ matrix.versions.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.python_version }}
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
- name: Ensure cassandra versions are set to ${{ matrix.cassandra_version.package_version }} | ${{ matrix.cassandra_version.tar_version }}
run: |
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.package_version }}\"/g' ${{ env.setup_cassandra_version_file }}
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.tar_version }}\"/g' ${{ env.setup_ccm_version_file }}
- name: Install ansible.posix
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: ansible-galaxy collection install ansible.posix -p ansible_collections/
- name: Run integration tests on Python ${{ matrix.test_scenario.python_version }} | ${{ matrix.test_scenario.docker_image }} | ${{ matrix.versions.ansible_version }} | ${{ matrix.cassandra_module }} | ${{ matrix.cassandra_version.package_version }}
run: ansible-test integration --docker ${{ matrix.test_scenario.docker_image }} ${{ matrix.test_scenario.ansible_test_options }} -v --color --retry-on-error --python ${{ matrix.test_scenario.python_version }} --continue-on-error --diff --coverage ${{ matrix.cassandra_module }}
- name: Generate coverage report.
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
- name: Upload Coverage data
run: tests/coverage.sh
integration_40x:
needs: integration_matrix
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ansible_collections/community/cassandra
strategy:
matrix:
versions:
- python_version: "3.10"
ansible_version: "stable-2.15"
- python_version: "3.10"
ansible_version: "stable-2.16"
- python_version: "3.11"
ansible_version: "devel"
cassandra_version:
- package_version: "40x"
tar_version: "4.0.5"
test_scenario:
#- docker_image: centos7
# python_version: "2.7"
# ansible_test_options: "--docker-privileged"
- docker_image: "ubuntu2204"
python_version: "3.10"
ansible_test_options: ""
cassandra_module: ${{ fromJson(needs.integration_matrix.outputs.matrix) }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/community/cassandra
- name: Set up Python ${{ matrix.versions.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.python_version }}
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
- name: Install ansible.posix
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: ansible-galaxy collection install ansible.posix -p ansible_collections/
- name: Ensure cassandra versions are set to ${{ matrix.cassandra_version.package_version }} | ${{ matrix.cassandra_version.tar_version }}
run: |
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.package_version }}\"/g' ${{ env.setup_cassandra_version_file }}
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.tar_version }}\"/g' ${{ env.setup_ccm_version_file }}
- name: Run integration tests on Python ${{ matrix.test_scenario.python_version }} | ${{ matrix.test_scenario.docker_image }} | ${{ matrix.versions.ansible_version }} | ${{ matrix.cassandra_module }} | ${{ matrix.cassandra_version.package_version }}
run: ansible-test integration --docker ${{ matrix.test_scenario.docker_image }} ${{ matrix.test_scenario.ansible_test_options }} -v --color --retry-on-error --python ${{ matrix.test_scenario.python_version }} --continue-on-error --diff --coverage ${{ matrix.cassandra_module }}
- name: Generate coverage report.
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
- name: Upload Coverage data
run: tests/coverage.sh
integration_41x:
needs: integration_matrix
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ansible_collections/community/cassandra
strategy:
matrix:
versions:
- python_version: "3.10"
ansible_version: "stable-2.15"
- python_version: "3.10"
ansible_version: "stable-2.16"
- python_version: "3.11"
ansible_version: "devel"
cassandra_version:
- package_version: "41x"
tar_version: "4.1.4"
test_scenario:
#- docker_image: centos7
# python_version: "2.7"
# ansible_test_options: "--docker-privileged"
- docker_image: "ubuntu2204"
python_version: "3.10"
ansible_test_options: ""
cassandra_module: ${{ fromJson(needs.integration_matrix.outputs.matrix) }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/community/cassandra
- name: Set up Python ${{ matrix.versions.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.python_version }}
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
- name: Install ansible.posix
uses: nick-invision/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
command: ansible-galaxy collection install ansible.posix -p ansible_collections/
- name: Ensure cassandra versions are set to ${{ matrix.cassandra_version.package_version }} | ${{ matrix.cassandra_version.tar_version }}
run: |
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.package_version }}\"/g' ${{ env.setup_cassandra_version_file }}
sed -i 's/^cassandra_version:.*/cassandra_version: \"${{ matrix.cassandra_version.tar_version }}\"/g' ${{ env.setup_ccm_version_file }}
- name: Run integration tests on Python ${{ matrix.test_scenario.python_version }} | ${{ matrix.test_scenario.docker_image }} | ${{ matrix.versions.ansible_version }} | ${{ matrix.cassandra_module }} | ${{ matrix.cassandra_version.package_version }}
run: ansible-test integration --docker ${{ matrix.test_scenario.docker_image }} ${{ matrix.test_scenario.ansible_test_options }} -v --color --retry-on-error --python ${{ matrix.test_scenario.python_version }} --continue-on-error --diff --coverage ${{ matrix.cassandra_module }}
- name: Generate coverage report.
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
- name: Upload Coverage data
run: tests/coverage.sh