From 3958a09909f899f2fed4fc02593afc93aa3c2b03 Mon Sep 17 00:00:00 2001 From: Vivekanand Ilango Date: Tue, 21 May 2024 13:47:34 +0200 Subject: [PATCH] Extract ddev, datadog_checks_base and datadog_checks_dev to separate workflows Include them as a separate job in relevant workflows --- .github/workflows/master.yml | 20 +- .github/workflows/nightly-base-package.yml | 16 +- .github/workflows/nightly-py2.yml | 16 +- .github/workflows/pr-all.yml | 18 +- .github/workflows/test-agent.yml | 20 +- .github/workflows/test-all.yml | 154 +--------------- .github/workflows/test-common.yml | 203 +++++++++++++++++++++ .github/workflows/weekly-latest.yml | 14 +- ddev/changelog.d/17602.fixed | 1 + ddev/src/ddev/cli/validate/ci.py | 4 + 10 files changed, 299 insertions(+), 167 deletions(-) create mode 100644 .github/workflows/test-common.yml create mode 100644 ddev/changelog.d/17602.fixed diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index b9c65bc912f12..4e3debfb25dec 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,7 +9,19 @@ jobs: cache: uses: ./.github/workflows/cache-shared-deps.yml - test: + test-common: + needs: + - cache + + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + standard: true + secrets: inherit + + test-integrations: needs: - cache @@ -23,7 +35,8 @@ jobs: publish-test-results: needs: - - test + - test-common + - test-integrations if: success() || failure() concurrency: group: test-results @@ -33,7 +46,8 @@ jobs: submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/.github/workflows/nightly-base-package.yml b/.github/workflows/nightly-base-package.yml index 75ef7a8eb58c4..41fa3cee1a89a 100644 --- a/.github/workflows/nightly-base-package.yml +++ b/.github/workflows/nightly-base-package.yml @@ -6,7 +6,18 @@ on: - cron: "0 5 * * *" jobs: - test: + test-common: + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + standard: true + minimum-base-package: true + test-py2: true + secrets: inherit + + test-integrations: uses: ./.github/workflows/test-all.yml with: repo: core @@ -19,7 +30,8 @@ jobs: submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/.github/workflows/nightly-py2.yml b/.github/workflows/nightly-py2.yml index 563d71890cf3a..653a24f351f7c 100644 --- a/.github/workflows/nightly-py2.yml +++ b/.github/workflows/nightly-py2.yml @@ -6,7 +6,18 @@ on: - cron: "0 4 * * *" jobs: - test: + test-common: + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + standard: true + test-py2: true + test-py3: false + secrets: inherit + + test-integrations: uses: ./.github/workflows/test-all.yml with: repo: core @@ -19,7 +30,8 @@ jobs: submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/.github/workflows/pr-all.yml b/.github/workflows/pr-all.yml index dbf2641211ff8..4ec6b6c80bb34 100644 --- a/.github/workflows/pr-all.yml +++ b/.github/workflows/pr-all.yml @@ -15,7 +15,17 @@ concurrency: cancel-in-progress: true jobs: - test: + test-common: + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + standard: true + test-py2: true + secrets: inherit + + test-integrations: uses: ./.github/workflows/test-all.yml with: repo: core @@ -27,14 +37,16 @@ jobs: save-event: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/save-event.yml submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/.github/workflows/test-agent.yml b/.github/workflows/test-agent.yml index 4cc4a86d90d06..6d711646d9197 100644 --- a/.github/workflows/test-agent.yml +++ b/.github/workflows/test-agent.yml @@ -35,7 +35,22 @@ on: type: string jobs: - test: + test-common: + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + standard: true + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + secrets: inherit + + test-integrations: uses: ./.github/workflows/test-all.yml with: repo: core @@ -52,7 +67,8 @@ jobs: submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 5ca8f198d8ab8..ceb69b00be7fe 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -1,4 +1,4 @@ -name: Test all +name: Test all integrations on: workflow_call: @@ -49,158 +49,6 @@ on: type: string jobs: - jd316aba: - uses: ./.github/workflows/test-target.yml - with: - job-name: ddev on Linux - target: ddev - platform: linux - runner: '["ubuntu-22.04"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - j6712d43: - uses: ./.github/workflows/test-target.yml - with: - job-name: ddev on Windows - target: ddev - platform: windows - runner: '["windows-2022"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - jb232c8c: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Base on Linux - target: datadog_checks_base - platform: linux - runner: '["ubuntu-22.04"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - jda96080: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Base on Windows - target: datadog_checks_base - platform: windows - runner: '["windows-2022"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - j77217e9: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Dev on Linux - target: datadog_checks_dev - platform: linux - runner: '["ubuntu-22.04"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - j1176210: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Dev on Windows - target: datadog_checks_dev - platform: windows - runner: '["windows-2022"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - j8cdb65b: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Downloader on Linux - target: datadog_checks_downloader - platform: linux - runner: '["ubuntu-22.04"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit - j8c73c41: - uses: ./.github/workflows/test-target.yml - with: - job-name: Datadog Checks Downloader on Windows - target: datadog_checks_downloader - platform: windows - runner: '["windows-2022"]' - repo: "${{ inputs.repo }}" - python-version: "${{ inputs.python-version }}" - standard: ${{ inputs.standard }} - latest: ${{ inputs.latest }} - agent-image: "${{ inputs.agent-image }}" - agent-image-py2: "${{ inputs.agent-image-py2 }}" - agent-image-windows: "${{ inputs.agent-image-windows }}" - agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" - test-py2: ${{ inputs.test-py2 }} - test-py3: ${{ inputs.test-py3 }} - minimum-base-package: ${{ inputs.minimum-base-package }} - secrets: inherit jd66e148: uses: ./.github/workflows/test-target.yml with: diff --git a/.github/workflows/test-common.yml b/.github/workflows/test-common.yml new file mode 100644 index 0000000000000..9ace82036037b --- /dev/null +++ b/.github/workflows/test-common.yml @@ -0,0 +1,203 @@ +name: Test areas common to integrations + +on: + workflow_call: + inputs: + repo: + required: true + type: string + + python-version: + required: false + default: "" + type: string + standard: + required: false + default: false + type: boolean + latest: + required: false + default: false + type: boolean + minimum-base-package: + required: false + default: false + type: boolean + test-py2: + required: false + default: false + type: boolean + test-py3: + required: false + default: true + type: boolean + agent-image: + required: false + default: "" + type: string + agent-image-py2: + required: false + default: "" + type: string + agent-image-windows: + required: false + default: "" + type: string + agent-image-windows-py2: + required: false + default: "" + type: string + +jobs: + jd316aba: + uses: ./.github/workflows/test-target.yml + with: + job-name: ddev on Linux + target: ddev + platform: linux + runner: '["ubuntu-22.04"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + j6712d43: + uses: ./.github/workflows/test-target.yml + with: + job-name: ddev on Windows + target: ddev + platform: windows + runner: '["windows-2022"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + jb232c8c: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Base on Linux + target: datadog_checks_base + platform: linux + runner: '["ubuntu-22.04"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + jda96080: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Base on Windows + target: datadog_checks_base + platform: windows + runner: '["windows-2022"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + j77217e9: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Dev on Linux + target: datadog_checks_dev + platform: linux + runner: '["ubuntu-22.04"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + j1176210: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Dev on Windows + target: datadog_checks_dev + platform: windows + runner: '["windows-2022"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + j8cdb65b: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Downloader on Linux + target: datadog_checks_downloader + platform: linux + runner: '["ubuntu-22.04"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit + j8c73c41: + uses: ./.github/workflows/test-target.yml + with: + job-name: Datadog Checks Downloader on Windows + target: datadog_checks_downloader + platform: windows + runner: '["windows-2022"]' + repo: "${{ inputs.repo }}" + python-version: "${{ inputs.python-version }}" + standard: ${{ inputs.standard }} + latest: ${{ inputs.latest }} + agent-image: "${{ inputs.agent-image }}" + agent-image-py2: "${{ inputs.agent-image-py2 }}" + agent-image-windows: "${{ inputs.agent-image-windows }}" + agent-image-windows-py2: "${{ inputs.agent-image-windows-py2 }}" + test-py2: ${{ inputs.test-py2 }} + test-py3: ${{ inputs.test-py3 }} + minimum-base-package: ${{ inputs.minimum-base-package }} + secrets: inherit diff --git a/.github/workflows/weekly-latest.yml b/.github/workflows/weekly-latest.yml index 697fec9bbc83e..97dfd5b3bd166 100644 --- a/.github/workflows/weekly-latest.yml +++ b/.github/workflows/weekly-latest.yml @@ -6,7 +6,16 @@ on: - cron: "0 5 * * 1" jobs: - test: + test-common: + uses: ./.github/workflows/test-common.yml + with: + repo: core + + # Options + latest: true + secrets: inherit + + test-integrations: uses: ./.github/workflows/test-all.yml with: repo: core @@ -17,7 +26,8 @@ jobs: submit-traces: needs: - - test + - test-common + - test-integrations if: success() || failure() uses: ./.github/workflows/submit-traces.yml diff --git a/ddev/changelog.d/17602.fixed b/ddev/changelog.d/17602.fixed new file mode 100644 index 0000000000000..b35348126ca50 --- /dev/null +++ b/ddev/changelog.d/17602.fixed @@ -0,0 +1 @@ +Extract ddev, datadog_checks_base and datadog_checks_dev to separate workflows diff --git a/ddev/src/ddev/cli/validate/ci.py b/ddev/src/ddev/cli/validate/ci.py index d883b477a4a64..aca9664683257 100644 --- a/ddev/src/ddev/cli/validate/ci.py +++ b/ddev/src/ddev/cli/validate/ci.py @@ -60,6 +60,10 @@ def ci(app: Application, sync: bool): if app.repo.name == 'core' else 'DataDog/integrations-core/.github/workflows/test-target.yml@master' ) + # TODO: Figure out a way to handle test-common.yml + # common_jobs_workflow_path = app.repo.path / '.github' / 'workflows' / 'test-common.yml' + # original_common_jobs_workflow = common_jobs_workflow_path.read_text() \ + # if common_jobs_workflow_path.is_file() else '' jobs_workflow_path = app.repo.path / '.github' / 'workflows' / 'test-all.yml' original_jobs_workflow = jobs_workflow_path.read_text() if jobs_workflow_path.is_file() else ''