From baedf603419ad8a68e0bb70dc915d94777437d8f Mon Sep 17 00:00:00 2001 From: ver217 Date: Mon, 19 Jun 2023 17:00:08 +0800 Subject: [PATCH 1/2] [devops] fix build on pr ci --- .github/workflows/build_on_pr.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_on_pr.yml b/.github/workflows/build_on_pr.yml index ac186a585d43..2058b471d2be 100644 --- a/.github/workflows/build_on_pr.yml +++ b/.github/workflows/build_on_pr.yml @@ -40,7 +40,7 @@ jobs: - name: Copy testmon cache run: | # branch name may contain slash, we need to replace it with space export REF_BRANCH=$(echo ${{ github.event.ref }} | sed "s/\// /") - if [ -d /github/home/testmon_cache/${MAIN_BRANCH} ] && [ ! -z "$(ls -A /github/home/testmon_cache/${MAIN_BRANCH})" ]; then + if [ -d /github/home/testmon_cache/${MAIN_BRANCH} ]; then cp -p -r /github/home/testmon_cache/${MAIN_BRANCH} "/github/home/testmon_cache/${REF_BRANCH}" fi env: @@ -67,8 +67,8 @@ jobs: - name: Copy testmon cache run: | # branch name may contain slash, we need to replace it with space export BASE=$(echo ${{ github.event.pull_request.base.ref }} | sed "s/\// /") - if [ -d "/github/home/testmon_cache/${BASE}" ] and [ ! -z "$(ls -A "/github/home/testmon_cache/${BASE}")" ]; then - mkdir -p /github/home/testmon_cache/_pull && cp -p -r "/github/home/testmon_cache/${BASE}" /github/home/testmon_cache/_pull/${PR_NUMBER} + if [ -d "/github/home/testmon_cache/${BASE}" ] && [ ! -z "$(ls -A "/github/home/testmon_cache/${BASE}")" ]; then + mkdir -p /github/home/testmon_cache/_pull/${PR_NUMBER} && cp -p -r "/github/home/testmon_cache/${BASE}/.testmondata*" /github/home/testmon_cache/_pull/${PR_NUMBER} fi env: PR_NUMBER: ${{ github.event.number }} @@ -200,8 +200,8 @@ jobs: - name: Restore Testmon Cache run: | - if [ -d /github/home/testmon_cache/_pull/${PR_NUMBER} ]; then - [ ! -z "$(ls -A /github/home/testmon_cache/_pull/${PR_NUMBER})" ] && cp -p -r /github/home/testmon_cache/_pull/${PR_NUMBER}/.testmondata* /__w/ColossalAI/ColossalAI/ + if [ -d /github/home/testmon_cache/_pull/${PR_NUMBER} ] && [ ! -z "$(ls -A /github/home/testmon_cache/_pull/${PR_NUMBER})" ]; then + cp -p -r /github/home/testmon_cache/_pull/${PR_NUMBER}/.testmondata* /__w/ColossalAI/ColossalAI/ fi env: PR_NUMBER: ${{ github.event.number }} From 6140edc25e2c903d6ef48aeeaa5e751f1f2344c6 Mon Sep 17 00:00:00 2001 From: ver217 Date: Mon, 19 Jun 2023 17:08:46 +0800 Subject: [PATCH 2/2] [devops] fix build on pr ci --- .github/workflows/build_on_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_on_pr.yml b/.github/workflows/build_on_pr.yml index 2058b471d2be..5f4e4feaa230 100644 --- a/.github/workflows/build_on_pr.yml +++ b/.github/workflows/build_on_pr.yml @@ -68,7 +68,7 @@ jobs: run: | # branch name may contain slash, we need to replace it with space export BASE=$(echo ${{ github.event.pull_request.base.ref }} | sed "s/\// /") if [ -d "/github/home/testmon_cache/${BASE}" ] && [ ! -z "$(ls -A "/github/home/testmon_cache/${BASE}")" ]; then - mkdir -p /github/home/testmon_cache/_pull/${PR_NUMBER} && cp -p -r "/github/home/testmon_cache/${BASE}/.testmondata*" /github/home/testmon_cache/_pull/${PR_NUMBER} + mkdir -p /github/home/testmon_cache/_pull/${PR_NUMBER} && cp -p -r "/github/home/testmon_cache/${BASE}"/.testmondata* /github/home/testmon_cache/_pull/${PR_NUMBER} fi env: PR_NUMBER: ${{ github.event.number }}