From 32b3b41c6b647f5cbe60d9d0a28265364f2f4599 Mon Sep 17 00:00:00 2001 From: aubin bikouo Date: Thu, 2 Apr 2026 14:44:15 +0200 Subject: [PATCH 1/2] update integration tests --- .github/workflows/integration.yml | 51 ++++++++++++------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b40c405c..1ba02ace 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,6 +1,6 @@ name: Integration on: - pull_request_target: + pull_request: types: - opened - reopened @@ -12,49 +12,44 @@ on: - stable-* jobs: - safe-to-test: - if: ${{ github.event.label.name == 'safe to test' }} || ${{ github.event.action != 'labeled' }} - uses: ansible-network/github_actions/.github/workflows/safe-to-test.yml@main splitter: - needs: - - safe-to-test runs-on: ubuntu-latest env: source_dir: "cloud_awsops" outputs: - test_targets: ${{ steps.splitter.outputs.test_targets }} - test_targets_json: ${{ steps.splitter.outputs.test_targets_json }} - test_jobs: ${{ steps.splitter.outputs.test_jobs }} + targets: ${{ steps.splitter.outputs.targets }} + test_jobs: ${{ steps.splitter.outputs.jobs }} steps: - name: Checkout collection - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.source_dir }} - ref: ${{ github.event.pull_request.head.sha }} fetch-depth: "0" - name: List changes for pull request id: splitter - uses: ansible-network/github_actions/.github/actions/ansible_test_splitter@main + uses: ansible/cloud-content-ci-automation/.github/actions/ansible_test_splitter@main with: collections_to_test: ${{ env.source_dir }} total_jobs: 2 + base_ref: "${{ github.event.pull_request.base.ref }}" - name: Display splitter output run: | - echo "test_targets=${{ steps.splitter.outputs.test_targets }}" - echo "test_targets_json=${{ steps.splitter.outputs.test_targets_json }}" - echo "test_jobs=${{ steps.splitter.outputs.test_jobs }}" + echo "test_targets=${{ steps.splitter.outputs.targets }}" + echo "test_jobs=${{ steps.splitter.outputs.jobs }}" shell: bash test: runs-on: ubuntu-latest needs: - splitter - if: ${{ needs.splitter.outputs.test_targets != '' }} + if: ${{ needs.splitter.outputs.targets != '' }} + environment: protected # requires manual approval within GitHub Actions to proceed env: source: "./source" ansible_version: "milestone" python_version: "3.12" + ansible_test_splitter_targets: "${{ needs.splitter.outputs.targets }}" strategy: fail-fast: false matrix: @@ -63,25 +58,20 @@ jobs: steps: - name: Read target id: read-targets - run: | - import json, os - with open(os.environ.get('GITHUB_OUTPUT'), "a", encoding="utf-8") as fh: - fh.write(f'ansible_test_targets={json.loads(os.environ.get("ALL_TEST_TARGETS")).get(os.environ.get("WORKFLOW_ID"))}\n') - shell: python - env: - ALL_TEST_TARGETS: ${{ needs.splitter.outputs.test_targets_json }} - WORKFLOW_ID: ${{ matrix.workflow-id }} + uses: ansible/cloud-content-ci-automation/.github/actions/ansible_read_targets@main + with: + job_id: "${{ matrix.workflow-id }}" + all_targets: "${{ env.ansible_test_splitter_targets }}" - name: Display ansible test targets run: | - echo "ansible_test_targets -> ${{ steps.read-targets.outputs.ansible_test_targets }}" + echo "ansible_test_targets -> ${{ steps.read-targets.outputs.job_targets }}" shell: bash - name: Checkout collection - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.source }} - ref: ${{ github.event.pull_request.head.sha }} - name: Set up Python ${{ env.python_version }} uses: actions/setup-python@v4 @@ -107,10 +97,7 @@ jobs: source_path: ${{ env.source }} - name: Create AWS/sts session credentials - uses: ansible-network/github_actions/.github/actions/ansible_aws_test_provider@main - with: - collection_path: ${{ steps.install.outputs.collection_path }} - ansible_core_ci_key: ${{ secrets.ANSIBLE_CORE_CI_KEY }} + uses: ansible/ansible-test-auth@v1 # we use raw git to create a repository in the tests # this fails if the committer doesn't have a name and an email set @@ -127,4 +114,4 @@ jobs: python_version: ${{ env.python_version }} ansible_version: ${{ env.ansible_version }} ansible_test_requirement_files: 'test-requirements.txt' - ansible_test_targets: ${{ steps.read-targets.outputs.ansible_test_targets }} + ansible_test_targets: ${{ steps.read-targets.outputs.job_targets }} From 95b3863c8f1fac9ffae9ccfe6824be912c9d01b9 Mon Sep 17 00:00:00 2001 From: Benny Rahmanim Date: Tue, 19 May 2026 18:18:33 +0300 Subject: [PATCH 2/2] fix linter issue --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1ba02ace..98e2bea8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -44,7 +44,7 @@ jobs: needs: - splitter if: ${{ needs.splitter.outputs.targets != '' }} - environment: protected # requires manual approval within GitHub Actions to proceed + environment: protected # requires manual approval within GitHub Actions to proceed env: source: "./source" ansible_version: "milestone"