From feefb4980f9e7b2326f960b468c36d591c7f8659 Mon Sep 17 00:00:00 2001 From: Yihan Zhao Date: Wed, 20 Nov 2024 13:14:41 +1100 Subject: [PATCH] Run tests using PR merge ref and run all necessary tests on release branches (#1045) --- .github/workflows/arm64_docker_marqo.yml | 1 + .github/workflows/cpu_docker_marqo.yml | 1 + .github/workflows/cpu_local_marqo.yml | 5 +++++ .github/workflows/cuda_docker_marqo.yml | 1 + .github/workflows/largemodel_unit_test_CI.yml | 5 +++++ .github/workflows/unit_test_200gb_CI.yml | 3 +++ 6 files changed, 16 insertions(+) diff --git a/.github/workflows/arm64_docker_marqo.yml b/.github/workflows/arm64_docker_marqo.yml index 25118af1b..83651dec9 100644 --- a/.github/workflows/arm64_docker_marqo.yml +++ b/.github/workflows/arm64_docker_marqo.yml @@ -29,6 +29,7 @@ on: push: branches: - mainline + - releases/* paths-ignore: - '**.md' diff --git a/.github/workflows/cpu_docker_marqo.yml b/.github/workflows/cpu_docker_marqo.yml index b1c7893e2..4e0d7a279 100644 --- a/.github/workflows/cpu_docker_marqo.yml +++ b/.github/workflows/cpu_docker_marqo.yml @@ -30,6 +30,7 @@ on: push: branches: - mainline + - releases/* paths-ignore: - '**.md' diff --git a/.github/workflows/cpu_local_marqo.yml b/.github/workflows/cpu_local_marqo.yml index 81543fe74..a281c2993 100644 --- a/.github/workflows/cpu_local_marqo.yml +++ b/.github/workflows/cpu_local_marqo.yml @@ -30,11 +30,13 @@ on: push: branches: - mainline + - releases/* paths-ignore: - '**.md' pull_request_target: branches: - mainline + - releases/* paths-ignore: - '**.md' @@ -92,6 +94,9 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + # if triggered by a pull_request_target event, we should use the merge ref of the PR + # if triggered by a push event, github.ref points to the head of the source branch + ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref }} - name: Set up Python 3.8 uses: actions/setup-python@v3 diff --git a/.github/workflows/cuda_docker_marqo.yml b/.github/workflows/cuda_docker_marqo.yml index fd05e4319..32f72d5fd 100644 --- a/.github/workflows/cuda_docker_marqo.yml +++ b/.github/workflows/cuda_docker_marqo.yml @@ -30,6 +30,7 @@ on: push: branches: - mainline + - releases/* paths-ignore: - '**.md' diff --git a/.github/workflows/largemodel_unit_test_CI.yml b/.github/workflows/largemodel_unit_test_CI.yml index 491b6f00c..9373f4bf3 100644 --- a/.github/workflows/largemodel_unit_test_CI.yml +++ b/.github/workflows/largemodel_unit_test_CI.yml @@ -7,11 +7,13 @@ on: push: branches: - mainline + - releases/* paths-ignore: - '**.md' pull_request_target: branches: - mainline + - releases/* paths-ignore: - '**.md' @@ -67,6 +69,9 @@ jobs: with: fetch-depth: 0 path: marqo + # if triggered by a pull_request_target event, we should use the merge ref of the PR + # if triggered by a push event, github.ref points to the head of the source branch + ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref }} - name: Set up Python 3.8 uses: actions/setup-python@v3 diff --git a/.github/workflows/unit_test_200gb_CI.yml b/.github/workflows/unit_test_200gb_CI.yml index 28ee50cfc..c0d9b8b39 100644 --- a/.github/workflows/unit_test_200gb_CI.yml +++ b/.github/workflows/unit_test_200gb_CI.yml @@ -65,6 +65,9 @@ jobs: with: fetch-depth: 0 path: marqo + # if triggered by a pull_request_target event, we should use the merge ref of the PR + # if triggered by a push event, github.ref points to the head of the source branch + ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.pull_request.number) || github.ref }} - name: Set up Python 3.8 uses: actions/setup-python@v3