Skip to content

chore(deps): bump actions/setup-python from 5.6.0 to 7.0.0 #20

chore(deps): bump actions/setup-python from 5.6.0 to 7.0.0

chore(deps): bump actions/setup-python from 5.6.0 to 7.0.0 #20

---
name: Test Contracts
on:
workflow_dispatch:
pull_request:
types: [labeled, opened, synchronize, reopened]
paths:
- 'roles/**'
- 'tests/integration/**'
- 'tests/fakes/**'
- '.github/workflows/test_contracts.yml'
push:
branches:
- main
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
contracts:
# Contract tests are fast, self-contained, and never need Incus — run on
# GitHub-hosted ubuntu so a self-hosted-runner outage does not block them.
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Install ansible-core
run: |
python -m pip install --upgrade pip
# Match the requirements-test.txt floor so contract tests exercise
# the same ansible-core the molecule matrix does.
pip install 'ansible-core>=2.18,<2.19'
- name: Install collection into ansible-galaxy path
run: |
mkdir -p "$HOME/.ansible/collections/ansible_collections/oddly"
ln -s "$PWD" "$HOME/.ansible/collections/ansible_collections/oddly/elasticstack"
ansible-galaxy collection install community.general community.crypto ansible.posix
- name: Run contract tests
run: |
set -euo pipefail
cd tests/integration
fail=0
for pb in *_contract.yml; do
# If a sibling *_inventory.ini exists, use it; otherwise the
# test targets localhost directly.
inv="${pb%_contract.yml}_inventory.ini"
if [ -f "$inv" ]; then
args=(-i "$inv")
else
args=(-i localhost,)
fi
echo "::group::${pb}"
if ! ansible-playbook "${args[@]}" -c local "$pb"; then
echo "::error::contract test ${pb} failed"
fail=1
fi
echo "::endgroup::"
done
exit "$fail"