From 68bd213ce91df9928324c88b3115e79bf16afb2d Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Thu, 13 Jun 2024 21:09:04 +0000 Subject: [PATCH] Change variable to string --- .github/workflows/test_bazel.yml | 7 ++++--- .github/workflows/test_cpp.yml | 6 +++--- .github/workflows/test_java.yml | 11 ++++++----- .github/workflows/test_runner.yml | 12 ++++++------ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test_bazel.yml b/.github/workflows/test_bazel.yml index e0df9b4f50..53a2446c1e 100644 --- a/.github/workflows/test_bazel.yml +++ b/.github/workflows/test_bazel.yml @@ -3,9 +3,10 @@ name: Bazel Tests on: workflow_call: inputs: - is-presubmit: - description: "True if we are in a presubmit run, false otherwise" - type: boolean + test-type: + required: true + description: "The type of test this is run from -- presubmit or continuous" + type: string safe-checkout: required: true description: "The SHA key for the commit we want to run over" diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml index 3fdc672a5d..2da0c41456 100644 --- a/.github/workflows/test_cpp.yml +++ b/.github/workflows/test_cpp.yml @@ -3,10 +3,10 @@ name: C++ Tests on: workflow_call: inputs: - is-presubmit: + test-type: required: true - description: "True if we are in a presubmit run, false otherwise" - type: boolean + description: "The type of test this is run from -- presubmit or continuous" + type: string safe-checkout: required: true description: "The SHA key for the commit we want to run over" diff --git a/.github/workflows/test_java.yml b/.github/workflows/test_java.yml index 3a34a1b0c6..9d807c8f2d 100644 --- a/.github/workflows/test_java.yml +++ b/.github/workflows/test_java.yml @@ -3,9 +3,10 @@ name: Java Tests on: workflow_call: inputs: - is-presubmit: - description: "True if we are in a presubmit run, false otherwise" - type: boolean + test-type: + required: true + description: "The type of test this is run from -- presubmit or continuous" + type: string safe-checkout: required: true description: "The SHA key for the commit we want to run over" @@ -26,12 +27,12 @@ jobs: # TODO: b/318555165 - enable the layering check. Currently it does # not work correctly with the toolchain in this Docker image. targets: //java/... //java/internal:java_version --features=-layering_check - if: ${{ !inputs.presubmit }} + if: ${{ inputs.test-type == 'continuous' }} - name: OpenJDK 11 (Continuous) version: '11' image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702 targets: //java/... //java/internal:java_version - if: ${{ !inputs.presubmit }} + if: ${{ inputs.test-type == 'continuous' }} - name: OpenJDK 17 version: '17' image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:17-1fdbb997433cb22c1e49ef75ad374a8d6bb88702 diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml index e485d1bb05..d348b856fe 100644 --- a/.github/workflows/test_runner.yml +++ b/.github/workflows/test_runner.yml @@ -77,9 +77,9 @@ jobs: # Store the sha for checkout so we can easily use it later. For safe # events, this will be blank and use the defaults. checkout-sha: ${{ steps.safe-checkout.outputs.sha }} - # Stores a boolean value denoting whether this is a presubmit run. This - # helps us determine which tests to block on. - run-as-presubmit: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} + # Stores a string denoting whether this is a presubmit or continuous + # run. This helps us determine which tests to block on. + test-type: ${{ (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && 'presubmit' || 'continuous' }} steps: - name: Check # Trivially pass for safe PRs, and explicitly error for unsafe ones @@ -117,7 +117,7 @@ jobs: needs: [check-tag] uses: ./.github/workflows/test_bazel.yml with: - is-presubmit: ${{ needs.check-tag.outputs.run-as-presubmit == 'true' }} + test-type: ${{ needs.check-tag.outputs.test-type }} safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} secrets: inherit @@ -126,7 +126,7 @@ jobs: needs: [check-tag] uses: ./.github/workflows/test_cpp.yml with: - is-presubmit: ${{ needs.check-tag.outputs.run-as-presubmit }} + test-type: ${{ needs.check-tag.outputs.test-type }} safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} secrets: inherit @@ -135,7 +135,7 @@ jobs: needs: [check-tag] uses: ./.github/workflows/test_java.yml with: - is-presubmit: ${{ needs.check-tag.outputs.run-as-presubmit }} + test-type: ${{ needs.check-tag.outputs.test-type }} safe-checkout: ${{ needs.check-tag.outputs.checkout-sha }} secrets: inherit