Debian Codegraph @

ansible_collections/splunk/es/.github/workflows/network_integration.yml

raw
1 ---
2 name: "Network Integration Tests"
3
4 concurrency:
5 group: ${{ github.actor == 'pre-commit-ci[bot]' && format('integration-bot-{0}', github.run_id) || 'integration' }}
6 cancel-in-progress: true
7
8 on:
9 pull_request_target:
10 branches: [main]
11 types:
12 - labeled
13 - opened
14 - reopened
15 - synchronize
16 paths:
17 - "plugins/**"
18 - "tests/integration/**"
19 workflow_dispatch:
20 schedule:
21 - cron: "0 1 */3 * *"
22
23 jobs:
24 check-actor:
25 name: Check Actor
26 if: github.actor != 'pre-commit-ci[bot]'
27 runs-on: ubuntu-latest
28 steps:
29 - run: echo "Actor ${{ github.actor }} is allowed to run integration tests"
30 safe-to-test:
31 needs:
32 - check-actor
33 if: >-
34 always() &&
35 needs.check-actor.result == 'success' &&
36 github.event_name == 'pull_request_target' &&
37 (github.event.label.name == 'safe to test' ||
38 github.event.action != 'labeled')
39 uses: ansible-network/github_actions/.github/workflows/safe-to-test.yml@main
40
41 approve:
42 name: Approve Integration
43 runs-on: ubuntu-latest
44 environment:
45 name: ${{ github.event_name == 'schedule' && 'eco-splunk-daily' || 'eco-splunk-protected' }}
46 needs:
47 - check-actor
48 - safe-to-test
49 if: >-
50 always() &&
51 needs.check-actor.result == 'success' &&
52 (needs.safe-to-test.result == 'success' || needs.safe-to-test.result == 'skipped')
53 steps:
54 - run: echo "Deployment approved"
55
56 network-integration:
57 name: "Integration (${{ matrix.ansible_version }})"
58 runs-on: [self-hosted]
59 needs:
60 - approve
61 if: always() && needs.approve.result == 'success'
62 strategy:
63 fail-fast: false
64 max-parallel: 1
65 matrix:
66 ansible_version:
67 - stable-2.16
68 - stable-2.17
69 - stable-2.18
70 - stable-2.19
71 - stable-2.20
72 - stable-2.21
73 steps:
74 - name: Checkout repository
75 uses: actions/checkout@v6
76 with:
77 path: ansible_collections/splunk/es
78 ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
79
80 - name: Install ansible-core (${{ matrix.ansible_version }})
81 working-directory: ansible_collections/splunk/es
82 run: |
83 rm -rf ~/venv-runner
84 python -m venv ~/venv-runner
85 source ~/venv-runner/bin/activate
86 pip install "git+https://github.com/ansible/ansible.git@${{ matrix.ansible_version }}"
87
88 - name: Install collection dependencies
89 run: |
90 source ~/venv-runner/bin/activate
91 ansible-galaxy collection install ansible.utils -p ./ansible_collections
92
93 - name: Generate inventory file
94 working-directory: ansible_collections/splunk/es
95 run: tests/integration/generate_inventory.sh
96 env:
97 SPLUNK_HOSTNAME: ${{ secrets.SPLUNK_HOSTNAME }}
98 SPLUNK_USERNAME: ${{ secrets.SPLUNK_USERNAME }}
99 SPLUNK_PASSWORD: ${{ secrets.SPLUNK_PASSWORD }}
100
101 - name: Run network integration tests
102 working-directory: ansible_collections/splunk/es
103 run: |
104 source ~/venv-runner/bin/activate
105 ansible-test network-integration -v --color yes