--- name: "Network Integration Tests" concurrency: group: ${{ github.actor == 'pre-commit-ci[bot]' && format('integration-bot-{0}', github.run_id) || 'integration' }} cancel-in-progress: true on: pull_request_target: branches: [main] types: - labeled - opened - reopened - synchronize paths: - "plugins/**" - "tests/integration/**" workflow_dispatch: schedule: - cron: "0 1 */3 * *" jobs: check-actor: name: Check Actor if: github.actor != 'pre-commit-ci[bot]' runs-on: ubuntu-latest steps: - run: echo "Actor ${{ github.actor }} is allowed to run integration tests" safe-to-test: needs: - check-actor if: >- always() && needs.check-actor.result == 'success' && github.event_name == 'pull_request_target' && (github.event.label.name == 'safe to test' || github.event.action != 'labeled') uses: ansible-network/github_actions/.github/workflows/safe-to-test.yml@main approve: name: Approve Integration runs-on: ubuntu-latest environment: name: ${{ github.event_name == 'schedule' && 'eco-splunk-daily' || 'eco-splunk-protected' }} needs: - check-actor - safe-to-test if: >- always() && needs.check-actor.result == 'success' && (needs.safe-to-test.result == 'success' || needs.safe-to-test.result == 'skipped') steps: - run: echo "Deployment approved" network-integration: name: "Integration (${{ matrix.ansible_version }})" runs-on: [self-hosted] needs: - approve if: always() && needs.approve.result == 'success' strategy: fail-fast: false max-parallel: 1 matrix: ansible_version: - stable-2.16 - stable-2.17 - stable-2.18 - stable-2.19 - stable-2.20 - stable-2.21 steps: - name: Checkout repository uses: actions/checkout@v6 with: path: ansible_collections/splunk/es ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }} - name: Install ansible-core (${{ matrix.ansible_version }}) working-directory: ansible_collections/splunk/es run: | rm -rf ~/venv-runner python -m venv ~/venv-runner source ~/venv-runner/bin/activate pip install "git+https://github.com/ansible/ansible.git@${{ matrix.ansible_version }}" - name: Install collection dependencies run: | source ~/venv-runner/bin/activate ansible-galaxy collection install ansible.utils -p ./ansible_collections - name: Generate inventory file working-directory: ansible_collections/splunk/es run: tests/integration/generate_inventory.sh env: SPLUNK_HOSTNAME: ${{ secrets.SPLUNK_HOSTNAME }} SPLUNK_USERNAME: ${{ secrets.SPLUNK_USERNAME }} SPLUNK_PASSWORD: ${{ secrets.SPLUNK_PASSWORD }} - name: Run network integration tests working-directory: ansible_collections/splunk/es run: | source ~/venv-runner/bin/activate ansible-test network-integration -v --color yes