Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .github/workflows/pull_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}