From aaaf1501a28d1713d007e528e3c07f678557540a Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Thu, 26 Oct 2023 14:35:55 -0700 Subject: [PATCH 1/2] Add test workflow --- .github/workflows/test-workflow-call.yaml | 14 ++++++++++++++ .github/workflows/test.yaml | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/test-workflow-call.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test-workflow-call.yaml b/.github/workflows/test-workflow-call.yaml new file mode 100644 index 000000000000..82e5c96060a3 --- /dev/null +++ b/.github/workflows/test-workflow-call.yaml @@ -0,0 +1,14 @@ +name: TestWorkflowCall +on: + workflow_call: + inputs: + cleanup: + type: boolean + required: true +jobs: + run-suite: + runs-on: ubuntu-latest + steps: + - if: ${{ inputs.cleanup }} + run: | + echo "Hello" \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000000..8202c758bbe7 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,13 @@ +name: Test +on: + workflow_dispatch: + inputs: + cleanup: + type: boolean + required: true + default: true +jobs: + run-suite: + uses: ./.github/workflows/test-workflow-call.yaml + with: + cleanup: ${{ inputs.cleanup }} \ No newline at end of file From a2b171f80b28b0d399511c42cb6767be6405149f Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Thu, 26 Oct 2023 14:46:13 -0700 Subject: [PATCH 2/2] Ensure that cleanup input is used on workflow_dispatch --- .github/workflows/alpha-e2e-scale-trigger.yaml | 3 ++- .github/workflows/e2e-cleanup.yaml | 3 +++ .github/workflows/e2e-conformance-trigger.yaml | 3 ++- .github/workflows/e2e-matrix-trigger.yaml | 3 ++- .github/workflows/e2e-scale-trigger.yaml | 3 ++- .github/workflows/test-workflow-call.yaml | 14 -------------- .github/workflows/test.yaml | 13 ------------- 7 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/test-workflow-call.yaml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/alpha-e2e-scale-trigger.yaml b/.github/workflows/alpha-e2e-scale-trigger.yaml index f25dc7ca29cb..699d81427217 100644 --- a/.github/workflows/alpha-e2e-scale-trigger.yaml +++ b/.github/workflows/alpha-e2e-scale-trigger.yaml @@ -38,6 +38,7 @@ jobs: region: ${{ inputs.region || 'us-west-2' }} enable_metrics: ${{ inputs.enable_metrics || true }} workflow_trigger: "alpha-scale" - cleanup: ${{ inputs.cleanup || true }} + # Default to true unless using a workflow_dispatch + cleanup: ${{ github.event_name != 'workflow_dispatch' && true || inputs.cleanup }} secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/e2e-cleanup.yaml b/.github/workflows/e2e-cleanup.yaml index ca753b1e20d2..7f16e6c548e2 100644 --- a/.github/workflows/e2e-cleanup.yaml +++ b/.github/workflows/e2e-cleanup.yaml @@ -19,6 +19,9 @@ jobs: name: cleanup-${{ inputs.cluster_name }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.git_ref }} - name: cleanup karpenter and cluster '${{ inputs.cluster_name }}' resources uses: ./.github/actions/e2e/cleanup with: diff --git a/.github/workflows/e2e-conformance-trigger.yaml b/.github/workflows/e2e-conformance-trigger.yaml index 251ee0476fbb..4f2e8e0063df 100644 --- a/.github/workflows/e2e-conformance-trigger.yaml +++ b/.github/workflows/e2e-conformance-trigger.yaml @@ -37,6 +37,7 @@ jobs: region: ${{ inputs.region || 'eu-west-1' }} k8s_version: ${{ matrix.k8s_version }} workflow_trigger: "conformance" - cleanup: ${{ inputs.cleanup || true }} + # Default to true unless using a workflow_dispatch + cleanup: ${{ github.event_name != 'workflow_dispatch' && true || inputs.cleanup }} secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/e2e-matrix-trigger.yaml b/.github/workflows/e2e-matrix-trigger.yaml index 48360660ca40..86cb283ad393 100644 --- a/.github/workflows/e2e-matrix-trigger.yaml +++ b/.github/workflows/e2e-matrix-trigger.yaml @@ -34,6 +34,7 @@ jobs: git_ref: ${{ needs.resolve.outputs.GIT_REF }} region: ${{ inputs.region || 'us-east-2' }} workflow_trigger: "matrix" - cleanup: ${{ inputs.cleanup || true }} + # Default to true unless using a workflow_dispatch + cleanup: ${{ github.event_name != 'workflow_dispatch' && true || inputs.cleanup }} secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/e2e-scale-trigger.yaml b/.github/workflows/e2e-scale-trigger.yaml index d69240e07b63..a711cf5ec9a4 100644 --- a/.github/workflows/e2e-scale-trigger.yaml +++ b/.github/workflows/e2e-scale-trigger.yaml @@ -38,6 +38,7 @@ jobs: region: ${{ inputs.region || 'us-west-2' }} enable_metrics: ${{ inputs.enable_metrics || true }} workflow_trigger: "scale" - cleanup: ${{ inputs.cleanup || true }} + # Default to true unless using a workflow_dispatch + cleanup: ${{ github.event_name != 'workflow_dispatch' && true || inputs.cleanup }} secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/test-workflow-call.yaml b/.github/workflows/test-workflow-call.yaml deleted file mode 100644 index 82e5c96060a3..000000000000 --- a/.github/workflows/test-workflow-call.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: TestWorkflowCall -on: - workflow_call: - inputs: - cleanup: - type: boolean - required: true -jobs: - run-suite: - runs-on: ubuntu-latest - steps: - - if: ${{ inputs.cleanup }} - run: | - echo "Hello" \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 8202c758bbe7..000000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Test -on: - workflow_dispatch: - inputs: - cleanup: - type: boolean - required: true - default: true -jobs: - run-suite: - uses: ./.github/workflows/test-workflow-call.yaml - with: - cleanup: ${{ inputs.cleanup }} \ No newline at end of file