From 7fe12107d6d16978207b381a41fe59b7c8943ed5 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 12:23:45 +0800 Subject: [PATCH 1/5] fix issue Signed-off-by: chensuyue --- .github/workflows/_get-test-matrix.yml | 2 +- .github/workflows/pr-examples-test.yml | 5 ++--- .github/workflows/pr-microservice-test.yml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_get-test-matrix.yml b/.github/workflows/_get-test-matrix.yml index deedaa949..581dca0d3 100644 --- a/.github/workflows/_get-test-matrix.yml +++ b/.github/workflows/_get-test-matrix.yml @@ -39,7 +39,7 @@ jobs: set -xe if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then LATEST_COMMIT_SHA=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/opea-project/GenAIComps/commits?sha=main" | jq -r '.[0].sha') + "https://api.github.com/repos/opea-project/GenAIComps/commits?sha=${GITHUB_REF#refs/heads/}" | jq -r '.[0].sha') echo "Latest commit SHA is $LATEST_COMMIT_SHA" base_commit=$LATEST_COMMIT_SHA else diff --git a/.github/workflows/pr-examples-test.yml b/.github/workflows/pr-examples-test.yml index a3eb50539..e3fe2b6ab 100644 --- a/.github/workflows/pr-examples-test.yml +++ b/.github/workflows/pr-examples-test.yml @@ -52,11 +52,10 @@ jobs: cat test_chatqna_on_gaudi.sh echo "Run test..." + echo "LOG_DIR=$(pwd)" >> $GITHUB_ENV export IMAGE_TAG="comps" timeout 50m bash test_chatqna_on_gaudi.sh - echo "LOG_PATH=$(pwd)/*.log" >> $GITHUB_ENV - - name: Clean up container if: cancelled() || failure() run: | @@ -69,4 +68,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: "Examples-Test-Logs" - path: ${{ env.LOG_PATH }} + path: ${{ env.LOG_DIR }}/*.log diff --git a/.github/workflows/pr-microservice-test.yml b/.github/workflows/pr-microservice-test.yml index f9dd45d8f..9e3870d9b 100644 --- a/.github/workflows/pr-microservice-test.yml +++ b/.github/workflows/pr-microservice-test.yml @@ -5,7 +5,7 @@ name: MicroService-test on: pull_request_target: - branches: [main] + branches: ['main','*rc'] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: - comps/** From 214f9faf9b671996a9af60fa3ce6d9be553b244e Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 12:34:58 +0800 Subject: [PATCH 2/5] for test only Signed-off-by: chensuyue --- .github/workflows/_get-test-matrix.yml | 1 - .github/workflows/pr-microservice-test.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/_get-test-matrix.yml b/.github/workflows/_get-test-matrix.yml index 581dca0d3..d4023ae26 100644 --- a/.github/workflows/_get-test-matrix.yml +++ b/.github/workflows/_get-test-matrix.yml @@ -25,7 +25,6 @@ jobs: else echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV fi - echo "checkout ref ${{ env.CHECKOUT_REF }}" - name: Checkout out Repo uses: actions/checkout@v4 diff --git a/.github/workflows/pr-microservice-test.yml b/.github/workflows/pr-microservice-test.yml index 9e3870d9b..616376a1b 100644 --- a/.github/workflows/pr-microservice-test.yml +++ b/.github/workflows/pr-microservice-test.yml @@ -4,7 +4,7 @@ name: MicroService-test on: - pull_request_target: + pull_request: branches: ['main','*rc'] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: From f635f8673fffe583801757adabdae928af1fa237 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 14:16:55 +0800 Subject: [PATCH 3/5] for test only Signed-off-by: chensuyue --- .github/workflows/_get-test-matrix.yml | 2 +- .github/workflows/pr-examples-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_get-test-matrix.yml b/.github/workflows/_get-test-matrix.yml index d4023ae26..301835fc8 100644 --- a/.github/workflows/_get-test-matrix.yml +++ b/.github/workflows/_get-test-matrix.yml @@ -38,7 +38,7 @@ jobs: set -xe if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then LATEST_COMMIT_SHA=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/opea-project/GenAIComps/commits?sha=${GITHUB_REF#refs/heads/}" | jq -r '.[0].sha') + "https://api.github.com/repos/opea-project/GenAIComps/commits?sha=${{ github.event.pull_request.base.ref }}" | jq -r '.[0].sha') echo "Latest commit SHA is $LATEST_COMMIT_SHA" base_commit=$LATEST_COMMIT_SHA else diff --git a/.github/workflows/pr-examples-test.yml b/.github/workflows/pr-examples-test.yml index e3fe2b6ab..3650d0c2e 100644 --- a/.github/workflows/pr-examples-test.yml +++ b/.github/workflows/pr-examples-test.yml @@ -4,7 +4,7 @@ name: Example-test on: - pull_request_target: + pull_request: branches: [main] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: From 22c12997dedd69d92d41bab87fe72f2aef56df91 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 06:18:25 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/pr-microservice-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-microservice-test.yml b/.github/workflows/pr-microservice-test.yml index 616376a1b..4528bcab5 100644 --- a/.github/workflows/pr-microservice-test.yml +++ b/.github/workflows/pr-microservice-test.yml @@ -5,7 +5,7 @@ name: MicroService-test on: pull_request: - branches: ['main','*rc'] + branches: ["main", "*rc"] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: - comps/** From f89a4372f75962a8b9b0f0f96ceb92077d8c4d3a Mon Sep 17 00:00:00 2001 From: chensuyue Date: Thu, 29 Aug 2024 15:17:37 +0800 Subject: [PATCH 5/5] remove test code Signed-off-by: chensuyue --- .github/workflows/pr-examples-test.yml | 2 +- .github/workflows/pr-microservice-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-examples-test.yml b/.github/workflows/pr-examples-test.yml index 3650d0c2e..e3fe2b6ab 100644 --- a/.github/workflows/pr-examples-test.yml +++ b/.github/workflows/pr-examples-test.yml @@ -4,7 +4,7 @@ name: Example-test on: - pull_request: + pull_request_target: branches: [main] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: diff --git a/.github/workflows/pr-microservice-test.yml b/.github/workflows/pr-microservice-test.yml index 4528bcab5..786b887c5 100644 --- a/.github/workflows/pr-microservice-test.yml +++ b/.github/workflows/pr-microservice-test.yml @@ -4,7 +4,7 @@ name: MicroService-test on: - pull_request: + pull_request_target: branches: ["main", "*rc"] types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped paths: