diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:03:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:03:42 +0000 |
commit | 66cec45960ce1d9c794e9399de15c138acb18aed (patch) | |
tree | 59cd19d69e9d56b7989b080da7c20ef1a3fe2a5a /ansible_collections/community/digitalocean/.github/workflows | |
parent | Initial commit. (diff) | |
download | ansible-upstream.tar.xz ansible-upstream.zip |
Adding upstream version 7.3.0+dfsg.upstream/7.3.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/community/digitalocean/.github/workflows')
5 files changed, 360 insertions, 0 deletions
diff --git a/ansible_collections/community/digitalocean/.github/workflows/ansible-test-integration.yml b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-integration.yml new file mode 100644 index 00000000..d2962f21 --- /dev/null +++ b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-integration.yml @@ -0,0 +1,80 @@ +name: integration +on: + push: + branches: + - main + schedule: + - cron: "10 6 * * *" + workflow_dispatch: + +concurrency: + group: cloud-integration-tests + cancel-in-progress: false + +jobs: + integration: + runs-on: ubuntu-latest + timeout-minutes: 40 + strategy: + fail-fast: false + max-parallel: 1 + matrix: + module: + - digital_ocean_account_info + - digital_ocean_balance_info + - digital_ocean_block_storage + - digital_ocean_cdn_endpoints + - digital_ocean_cdn_endpoints_info + - digital_ocean_certificate + - digital_ocean_certificate_info + - digital_ocean_database + - digital_ocean_database_info + - digital_ocean_domain + - digital_ocean_domain_info + - digital_ocean_domain_record + - digital_ocean_domain_record_info + - digital_ocean_droplet + - digital_ocean_droplet_info + - digital_ocean_firewall + - digital_ocean_firewall_info + - digital_ocean_floating_ip + - digital_ocean_floating_ip_info + - digital_ocean_image_info + - digital_ocean_kubernetes + - digital_ocean_kubernetes_info + - digital_ocean_load_balancer + - digital_ocean_load_balancer_info + - digital_ocean_monitoring_alerts + - digital_ocean_monitoring_alerts_info + - digital_ocean_project + - digital_ocean_project_info + - digital_ocean_region_info + - digital_ocean_size_info + - digital_ocean_snapshot + - digital_ocean_snapshot_info + - digital_ocean_spaces + - digital_ocean_spaces_info + - digital_ocean_sshkey + - digital_ocean_sshkey_info + - digital_ocean_tag + - digital_ocean_tag_info + - digital_ocean_volume_info + - digital_ocean_vpc + - digital_ocean_vpc_info + + steps: + - name: Perform testing + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + pre-test-cmd: >- + DO_API_KEY=${{ secrets.DO_API_KEY }} + AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} + ./tests/utils/render.sh + tests/integration/integration_config.yml.template + > tests/integration/integration_config.yml + origin-python-version: 3.9 + target: ${{ matrix.module }} + target-python-version: 3.9 + testing-type: integration + test-deps: community.general diff --git a/ansible_collections/community/digitalocean/.github/workflows/ansible-test-sanity.yml b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-sanity.yml new file mode 100644 index 00000000..95cde900 --- /dev/null +++ b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-sanity.yml @@ -0,0 +1,52 @@ +name: sanity +on: + pull_request: + types: [ opened, synchronize, reopened ] + push: + branches: [ main ] + schedule: + - cron: '0 6 * * *' + +jobs: + + sanity_29: + timeout-minutes: 30 + name: Sanity (Ⓐ$${{ matrix.ansible }}) + strategy: + matrix: + ansible: + - stable-2.9 + runs-on: ubuntu-latest + steps: + - name: Perform testing + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + ansible-core-version: ${{ matrix.ansible }} + # pre-test-cmd: + python-version: 3.8 + target-python-version: 3.8 + testing-type: sanity + # test-deps: + + sanity: + timeout-minutes: 30 + name: Sanity (Ⓐ$${{ matrix.ansible }}) + strategy: + matrix: + ansible: + - stable-2.10 + - stable-2.11 + - stable-2.12 + - stable-2.13 + - devel + runs-on: ubuntu-latest + steps: + - name: Perform testing + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + ansible-core-version: ${{ matrix.ansible }} + # pre-test-cmd: + python-version: 3.9 + target-python-version: 3.9 + testing-type: sanity + # test-deps: diff --git a/ansible_collections/community/digitalocean/.github/workflows/ansible-test-unit.yml b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-unit.yml new file mode 100644 index 00000000..4b3615c1 --- /dev/null +++ b/ansible_collections/community/digitalocean/.github/workflows/ansible-test-unit.yml @@ -0,0 +1,60 @@ +name: unit +on: + pull_request: + types: [ opened, synchronize, reopened ] + push: + branches: [ main ] + schedule: + - cron: '10 6 * * *' + +jobs: + + units_29: + runs-on: ubuntu-latest + timeout-minutes: 30 + name: Units (Ⓐ${{ matrix.ansible }}) + strategy: + fail-fast: true + matrix: + ansible: + - stable-2.9 + steps: + - name: Perform testing + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + ansible-core-version: ${{ matrix.ansible }} + # pre-test-cmd: + python-version: 3.8 + target-python-version: 3.8 + testing-type: units + test-deps: >- + ansible.netcommon + ansible.utils + community.general + + units: + runs-on: ubuntu-latest + timeout-minutes: 30 + name: Units (Ⓐ${{ matrix.ansible }}) + strategy: + fail-fast: true + matrix: + ansible: + - stable-2.10 + - stable-2.11 + - stable-2.12 + - stable-2.13 + - devel + steps: + - name: Perform testing + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + ansible-core-version: ${{ matrix.ansible }} + # pre-test-cmd: + python-version: 3.9 + target-python-version: 3.9 + testing-type: units + test-deps: >- + ansible.netcommon + ansible.utils + community.general diff --git a/ansible_collections/community/digitalocean/.github/workflows/black.yml b/ansible_collections/community/digitalocean/.github/workflows/black.yml new file mode 100644 index 00000000..ce6685b0 --- /dev/null +++ b/ansible_collections/community/digitalocean/.github/workflows/black.yml @@ -0,0 +1,16 @@ +# https://black.readthedocs.io/en/stable/integrations/github_actions.html +name: black + +on: + pull_request: + types: [ opened, synchronize, reopened ] + push: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v2 + - uses: psf/black@stable diff --git a/ansible_collections/community/digitalocean/.github/workflows/pull-request-integration.yml b/ansible_collections/community/digitalocean/.github/workflows/pull-request-integration.yml new file mode 100644 index 00000000..b70f30e3 --- /dev/null +++ b/ansible_collections/community/digitalocean/.github/workflows/pull-request-integration.yml @@ -0,0 +1,152 @@ +name: pull-request-integration + +on: + pull_request_target: + branches: [main] + types: [opened, synchronize, reopened] + paths: + - plugins/module_utils/** + - plugins/modules/** + +concurrency: + group: cloud-integration-tests + cancel-in-progress: false + +env: + DEFAULT_BRANCH: remotes/origin/main + +jobs: + changes: + # Require reviewers for this environment + # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ + environment: integration + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + + - name: show changes files + run: | + git diff --name-only $DEFAULT_BRANCH + + - name: get changed module_utils + id: changed-module-utils + run: | + basenames=() + for file in $(git diff --name-only $DEFAULT_BRANCH | grep 'plugins/module_utils/'); do + basenames+=($(basename $file .py)) + done + printf '::set-output name=matrix::%s\n' $(printf '%s\n' "${basenames[@]}" | jq -R . | jq -sc .) + + - name: get changed modules + id: changed-modules + run: | + basenames=() + for file in $(git diff --name-only $DEFAULT_BRANCH | grep 'plugins/modules/'); do + basenames+=($(basename $file .py)) + done + printf '::set-output name=matrix::%s\n' $(printf '%s\n' "${basenames[@]}" | jq -R . | jq -sc .) + + outputs: + module-utils-matrix: ${{ steps.changed-module-utils.outputs.matrix }} + module-matrix: ${{ steps.changed-modules.outputs.matrix }} + + test-module-utils: + environment: integration + runs-on: ubuntu-latest + timeout-minutes: 120 + needs: [changes] + if: ${{ needs.changes.outputs.module-utils-matrix != '[""]' }} + strategy: + fail-fast: false + max-parallel: 1 + matrix: + module: + - digital_ocean_account_info + - digital_ocean_balance_info + - digital_ocean_block_storage + - digital_ocean_cdn_endpoints + - digital_ocean_cdn_endpoints_info + - digital_ocean_certificate + - digital_ocean_certificate_info + - digital_ocean_database + - digital_ocean_database_info + - digital_ocean_domain + - digital_ocean_domain_info + - digital_ocean_domain_record + - digital_ocean_domain_record_info + - digital_ocean_droplet + - digital_ocean_droplet_info + - digital_ocean_firewall + - digital_ocean_firewall_info + - digital_ocean_floating_ip + - digital_ocean_floating_ip_info + - digital_ocean_image_info + - digital_ocean_kubernetes + - digital_ocean_kubernetes_info + - digital_ocean_load_balancer + - digital_ocean_load_balancer_info + - digital_ocean_monitoring_alerts + - digital_ocean_monitoring_alerts_info + - digital_ocean_project + - digital_ocean_project_info + - digital_ocean_region_info + - digital_ocean_size_info + - digital_ocean_snapshot + - digital_ocean_snapshot_info + - digital_ocean_spaces + - digital_ocean_spaces_info + - digital_ocean_sshkey + - digital_ocean_sshkey_info + - digital_ocean_tag + - digital_ocean_tag_info + - digital_ocean_volume_info + - digital_ocean_vpc + - digital_ocean_vpc_info + steps: + - name: Perform testing (all modules) + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + git-checkout-ref: ${{ github.event.pull_request.head.sha }} + pre-test-cmd: >- + DO_API_KEY=${{ secrets.DO_API_KEY }} + AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} + ./tests/utils/render.sh + tests/integration/integration_config.yml.template + > tests/integration/integration_config.yml + origin-python-version: 3.9 + target-python-version: 3.9 + testing-type: integration + test-deps: community.general + target: ${{ matrix.module }} + + test-modules: + environment: integration + runs-on: ubuntu-latest + timeout-minutes: 40 + needs: [changes] + if: ${{ needs.changes.outputs.module-utils-matrix == '[""]' && needs.changes.outputs.module-matrix != '[""]' }} + strategy: + fail-fast: false + matrix: + module: ${{ fromJSON(needs.changes.outputs.module-matrix) }} + steps: + - name: Perform testing (changed module) + uses: ansible-community/ansible-test-gh-action@release/v1 + with: + git-checkout-ref: ${{ github.event.pull_request.head.sha }} + pre-test-cmd: >- + DO_API_KEY=${{ secrets.DO_API_KEY }} + AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} + ./tests/utils/render.sh + tests/integration/integration_config.yml.template + > tests/integration/integration_config.yml + origin-python-version: 3.9 + target-python-version: 3.9 + testing-type: integration + test-deps: community.general + target: ${{ matrix.module }} |