From da8b24e821f48f75ec5318067ba3e45bd8e5ebbf Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Thu, 11 Apr 2024 21:03:29 +0100 Subject: [PATCH] Condition for PR to main with windows updated --- .github/workflows/e2e-tests.yml | 21 +++++++++++++++++++-- .github/workflows/unit-tests.yml | 21 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index dadf870f50..3a77d95166 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -12,8 +12,25 @@ on: jobs: e2e_tests: runs-on: ${{ inputs.os }} - # Only run on main and demo branches for Windows - if: inputs.os == 'ubuntu-latest' || ((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/demo') && inputs.os == 'windows-latest') + + # below condition checks if the operating system is Ubuntu, or + # Run on Windows and + # main/demo branch or + # pull request to main with Python 3.10 + if: > + inputs.os == 'ubuntu-latest' || + ( + ( + github.ref == 'refs/heads/main' || + github.ref == 'refs/heads/demo' || + ( + github.event.pull_request.base.ref == 'main' && + inputs.python-version == '3.10' + ) + ) && + inputs.os == 'windows-latest' + ) + steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7a5bd735c3..23e74bae16 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,8 +12,25 @@ on: jobs: unit_tests: runs-on: ${{ inputs.os }} - # Only run on main and demo branches for Windows - if: inputs.os == 'ubuntu-latest' || ((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/demo') && inputs.os == 'windows-latest') + + # below condition checks if the operating system is Ubuntu, or + # Run on Windows and + # main/demo branch or + # pull request to main with Python 3.10 + if: > + inputs.os == 'ubuntu-latest' || + ( + ( + github.ref == 'refs/heads/main' || + github.ref == 'refs/heads/demo' || + ( + github.event.pull_request.base.ref == 'main' && + inputs.python-version == '3.10' + ) + ) && + inputs.os == 'windows-latest' + ) + steps: - name: Checkout code uses: actions/checkout@v4