diff --git a/.github/workflows/pull_img.yml b/.github/workflows/pull_img.yml index 0635281..14b9eb6 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: @@ -35,30 +35,22 @@ 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) }} - 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 + 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 }}