forked from PaddlePaddle/PaddleCustomDevice
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (93 loc) · 3.01 KB
/
_Clone-linux.yml
File metadata and controls
102 lines (93 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Clone-linux
on:
workflow_call:
inputs:
workflow-name:
type: string
required: false
clone_dir:
type: string
required: false
default: 'PaddlecustomDevice'
is_pr:
type: string
required: false
default: 'true'
outputs:
can-skip:
value: ${{ jobs.clone.outputs.can-skip }}
slice-check:
value: ${{ jobs.clone.outputs.slice-check }}
permissions: read-all
defaults:
run:
shell: bash
env:
PR_ID: ${{ github.event.pull_request.number || '0' }}
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
ci_scripts: ${{ github.workspace }}/ci
BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
jobs:
clone:
name: Clone PaddlecustomDevice
if: ${{ github.repository_owner == 'PaddlePaddle' }}
outputs:
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
slice-check: ${{ steps.check-execution.outputs.slice-check }}
runs-on:
group: HK-Clone
steps:
- name: Clone PaddleCustomDevice
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
submodules: 'recursive'
fetch-depth: 1000
- name: Merge PR to test branch
id: check-execution
if: ${{ inputs.is_pr == 'true' }}
run: |
set -x
git config user.name "PaddleCI"
git config user.email "paddle_ci@example.com"
git fetch origin pull/${{ github.event.pull_request.number }}/head
git checkout -b test FETCH_HEAD
git merge --no-edit ${BRANCH}
git submodule sync
git submodule update --init --recursive --force
cd Paddle/third_party/protobuf
git fetch --tags
cd ../pybind
git fetch --tags
cd ../../..
- name: Download bos client
env:
home_path: "/home/paddle/actions-runner/"
bos_file: "/home/paddle/actions-runner/bos/BosClient.py"
run: |
if [ ! -f "${bos_file}" ]; then
wget -q --no-proxy -O ${home_path}/bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate
mkdir ${home_path}/bos
tar xf ${home_path}/bos_new.tar.gz -C ${home_path}/bos
fi
- name: Push paddle-action.tar.gz to bos
env:
AK: paddle
SK: paddle
bos_file: "/home/paddle/actions-runner/bos/BosClient.py"
run: |
set -x
cd ..
pwd
ls
tar -I 'zstd -T0' -cf PaddleCustomDevice.tar.gz PaddleCustomDevice
echo "::group::Install bce-python-sdk"
python -m pip install bce-python-sdk==0.8.74
echo "::endgroup::"
python ${bos_file} PaddleCustomDevice.tar.gz paddle-github-action/PaddleCustomDevice/PR/${PR_ID}/${COMMIT_ID}
rm PaddleCustomDevice.tar.gz
cd -
git switch ${BRANCH}
set +e
git branch -D test
git gc