Collection integration #381
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Collection integration | |
on: | |
pull_request: | |
types: [labeled] | |
push: | |
paths: | |
- "plugins/**" | |
- "tests/integration/**" | |
schedule: | |
- cron: 56 3 * * 2 # Run weekly | |
jobs: | |
integration-test: | |
name: Integration test Ansible ${{ matrix.ansible }} Py${{ matrix.python }} | |
if: ${{ github.event.label.name == 'automation' || github.ref_name == 'main' || github.event_name == 'schedule' }} | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ansible_collections/vultr/cloud | |
strategy: | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
ansible: | |
- stable-2.17 | |
python: | |
- "3.11" | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
path: ansible_collections/vultr/cloud | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install ansible-base (${{ matrix.ansible }}) | |
run: | | |
python -m pip install --upgrade pip | |
pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check | |
- name: Build and install collection | |
run: | | |
ansible-galaxy collection build . | |
ansible-galaxy collection install *.gz | |
- name: Add config file | |
env: | |
VULTR_CONFIG_FILE: ${{ secrets.VULTR_CONFIG_FILE }} | |
run: | | |
echo "$VULTR_CONFIG_FILE" > tests/integration/cloud-config-vultr.ini | |
- name: Ensure no other integration test is currently running | |
uses: softprops/turnstyle@v2 | |
timeout-minutes: 60 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
same-branch-only: false | |
- name: Run the tests | |
run: >- | |
ansible-test | |
integration | |
--docker | |
-v | |
--color | |
--continue-on-error | |
--diff | |
--python ${{ matrix.python }} | |
--coverage | |
cloud/vultr/ | |
- name: Generate coverage report | |
run: >- | |
ansible-test | |
coverage xml | |
-v | |
--requirements | |
--group-by command | |
--group-by version | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: false |