From 470d6e55bfbe48509a015f9b909021c9cfb27434 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 26 Aug 2021 23:28:07 +0800 Subject: [PATCH 1/4] refein --- .github/workflows/pull_img.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_img.yml b/.github/workflows/pull_img.yml index 0635281..bbd1d4d 100644 --- a/.github/workflows/pull_img.yml +++ b/.github/workflows/pull_img.yml @@ -36,6 +36,7 @@ jobs: echo ${{ contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ !contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ toJSON(github.event.pull_request.labels.*.name) }} + IMG_NAME=${IMG_NAME:-"busybox"} COMPRESS=${COMPRESS:-"1"} OSSPATH=${OSSPATH:-"oss://oneflow-static/img"} From 2fe7879c359c0f5ff7d2ff6a4c7cfa994694a43e Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 26 Aug 2021 23:30:20 +0800 Subject: [PATCH 2/4] refein --- .github/workflows/pull_img.yml | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.github/workflows/pull_img.yml b/.github/workflows/pull_img.yml index bbd1d4d..579a4b4 100644 --- a/.github/workflows/pull_img.yml +++ b/.github/workflows/pull_img.yml @@ -5,7 +5,7 @@ on: branches: - master pull_request: - types: [synchronize, opened, reopened, ready_for_review] + types: [synchronize, opened, reopened, ready_for_review, labeled, unlabeled] branches: - "*" workflow_dispatch: @@ -36,30 +36,3 @@ jobs: echo ${{ contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ !contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ toJSON(github.event.pull_request.labels.*.name) }} - - IMG_NAME=${IMG_NAME:-"busybox"} - COMPRESS=${COMPRESS:-"1"} - OSSPATH=${OSSPATH:-"oss://oneflow-static/img"} - echo "GITHUB_RUN_ID:${GITHUB_RUN_ID}" - set -x - set -o pipefail - python3 -m pip install pathvalidate - export sanitized_file=$(python3 sanitize_filename.py) - export tar_file=${sanitized_file}.tar - export gz_file=${tar_file}.gz - - curl http://gosspublic.alicdn.com/ossutil/1.6.19/ossutil64 -o $HOME/ossutil64 - chmod 755 $HOME/ossutil64 - $HOME/ossutil64 config -e oss-cn-beijing.aliyuncs.com -i ${OSS_ACCESS_KEY_ID} -k ${OSS_ACCESS_KEY_SECRET} -L EN -c $HOME/.ossutilconfig - - if [ "${COMPRESS}" = "1" ]; then - docker pull ${IMG_NAME} - docker save ${IMG_NAME} | gzip > ${gz_file} - $HOME/ossutil64 --update cp ${gz_file} ${OSSPATH}/${gz_file} - else - docker run --rm -v $PWD:$PWD -w $PWD ananace/skopeo copy docker://${IMG_NAME} dir:${sanitized_file} - echo "${IMG_NAME}" > ${sanitized_file}.tag - - $HOME/ossutil64 --update cp --recursive ${sanitized_file} ${OSSPATH}/${sanitized_file} - $HOME/ossutil64 --update cp ${sanitized_file}.tag ${OSSPATH}/${sanitized_file}.tag - fi From 41b85a6227eacd277f8f270ae70bdb2f1a64505c Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 26 Aug 2021 23:32:31 +0800 Subject: [PATCH 3/4] refine --- .github/workflows/pull_img.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_img.yml b/.github/workflows/pull_img.yml index 579a4b4..481bd7c 100644 --- a/.github/workflows/pull_img.yml +++ b/.github/workflows/pull_img.yml @@ -35,4 +35,4 @@ jobs: run: | echo ${{ contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ !contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} - echo ${{ toJSON(github.event.pull_request.labels.*.name) }} + echo "${{ join(github.event.pull_request.labels.*.name, ', ') }}" From 5bc5f299ed33aa65c84b9a22fba5df1d36371606 Mon Sep 17 00:00:00 2001 From: tsai Date: Fri, 27 Aug 2021 00:24:09 +0800 Subject: [PATCH 4/4] refine --- .github/workflows/pull_img.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/pull_img.yml b/.github/workflows/pull_img.yml index 481bd7c..14b9eb6 100644 --- a/.github/workflows/pull_img.yml +++ b/.github/workflows/pull_img.yml @@ -36,3 +36,21 @@ jobs: echo ${{ contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo ${{ !contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} echo "${{ join(github.event.pull_request.labels.*.name, ', ') }}" + test-job: + runs-on: ubuntu-latest + strategy: + matrix: + node: [10, 12, 14] + steps: + - uses: actions/checkout@v2 + - env: + IMG_NAME: ${{ github.event.inputs.img }} + COMPRESS: ${{ github.event.inputs.compress }} + OSSPATH: ${{ github.event.inputs.ossPath }} + OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} + OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} + run: | + echo ${{ contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} + echo ${{ !contains(github.event.pull_request.labels.*.name, 'need-single-client-tests') }} + echo "${{ join(github.event.pull_request.labels.*.name, ', ') }}" + steps: ${{ matrix.steps }}