.gitlab-ci.yml 5.4 KB
Newer Older
S
superjomn 已提交
1 2
before_script:
  - env
C
Chunwei 已提交
3
  - export CI_USER_DIR=$(pwd)
S
superjomn 已提交
4

C
Chunwei 已提交
5 6 7 8 9 10 11 12 13 14
  # prepare ccache
  - apt install ccache

  # for proxy
  - export http_proxy=$CI_PROXY
  - export https_proxy=$CI_PROXY

  # merge the latest code
  - git config --global user.email "you@example.com"
  - git config --global user.name "Your Name"
H
Huihuang Zheng 已提交
15
  - git reset --hard HEAD # ignore any local changes in CI node.
C
Chunwei 已提交
16
  - git fetch origin incubate/lite
H
Huihuang Zheng 已提交
17 18
  - git status -s
  - git branch
C
Chunwei 已提交
19
  - git merge --no-ff origin/incubate/lite
H
Huihuang Zheng 已提交
20
  #- git checkout origin/incubate/lite && git log -1 && 
C
Chunwei 已提交
21 22


S
superjomn 已提交
23 24 25 26
image: $SERVER_LITE_DOCKER_IMAGE

stages:
  - ci
S
up  
superjomn 已提交
27 28
  - build_server
  - build_mobile
S
superjomn 已提交
29 30

check:prebuilt:
S
fix ci  
superjomn 已提交
31 32
    tags:
        - lite
S
up  
superjomn 已提交
33 34
    stage: ci
    script:
C
Chunwei 已提交
35
        # prepare for pre-commit
S
up  
superjomn 已提交
36
        - rm -rf ~/.pip
S
up  
superjomn 已提交
37
        - pip install pre-commit
S
update  
superjomn 已提交
38
        - pre-commit install
C
Chunwei 已提交
39

S
update  
superjomn 已提交
40
        - ./paddle/fluid/lite/tools/build.sh check_style
C
Chunwei 已提交
41

S
superjomn 已提交
42 43 44
    cache:
        key: check_style
        paths:
C
Chunwei 已提交
45
            - $CI_USER_DIR/.cache
S
superjomn 已提交
46 47

build:server:
S
fix ci  
superjomn 已提交
48 49
    tags:
        - lite
S
up  
superjomn 已提交
50
    image: $SERVER_LITE_DOCKER_IMAGE
S
up  
superjomn 已提交
51
    stage: build_server
S
up  
superjomn 已提交
52 53 54 55
    cache:
        key: server_thirdparty
        paths:
            - build/third_party
C
Chunwei 已提交
56
            - ~/.ccache
C
Chunwei 已提交
57
            - $CI_PROJECT_DIR/_build_server_ccache
S
up  
superjomn 已提交
58
    script:
C
Chunwei 已提交
59 60 61
        # customize ccache path for specifying runner cache
        - export CCACHE_DIR=$CI_PROJECT_DIR/_build_server_ccache
        # run build and test
S
up  
superjomn 已提交
62 63 64 65 66
        - mkdir -p build
        - cd build
        - ../paddle/fluid/lite/tools/build.sh cmake_x86
        - make extern_eigen3
        - make extern_boost
S
up  
superjomn 已提交
67 68
        - make framework_proto
        - make extern_warpctc
S
up  
superjomn 已提交
69 70 71
        - cd ..
        - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/build/third_party/install/mklml/lib
        - ./paddle/fluid/lite/tools/build.sh build_test_server
S
up  
superjomn 已提交
72 73 74
    dependencies:
        - check:prebuilt

C
Chunwei 已提交
75 76 77 78 79 80 81 82
build:mobile_android:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
83 84
            - build.lite.android.armv8.gcc/third_party
            - build.lite.android.armv7.gcc/third_party
C
Chunwei 已提交
85 86 87 88 89 90 91 92 93
            - ~/.ccache
            - $CI_PROJECT_DIR/build_mobile_ccache
    script:
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_ccache
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_subtask_android

    dependencies:
        - build:server

Z
ZhenWang 已提交
94 95 96 97 98 99 100 101
build:mobile_android_cl:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
    cache:
        key: mobile_thirdparty
        paths:
102 103
            - build.lite.android.armv8.gcc.opencl/third_party
            - build.lite.android.armv7.gcc.opencl/third_party
Z
ZhenWang 已提交
104 105 106 107 108 109 110 111 112
            - ~/.ccache
            - $CI_PROJECT_DIR/build_mobile_ccache_cl
    script:
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_ccache_cl
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_opencl

    dependencies:
        - build:server

C
Chunwei 已提交
113
build:mobile_armlinux:
S
fix ci  
superjomn 已提交
114 115
    tags:
        - lite
S
up  
superjomn 已提交
116
    stage: build_mobile
S
superjomn 已提交
117
    image: $MOBILE_LITE_DOCKER_IMAGE
S
up  
superjomn 已提交
118 119 120
    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
121 122 123
            - build.lite.armlinux.armv8.gcc
            - build.lite.armlinux.armv7.gcc
            - build.lite.armlinux.armv7hf.gcc
C
Chunwei 已提交
124
            - ~/.ccache
C
Chunwei 已提交
125
            - $CI_PROJECT_DIR/build_mobile_ccache2
S
superjomn 已提交
126
    script:
C
Chunwei 已提交
127 128 129 130 131
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_ccache2
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_subtask_armlinux

    dependencies:
        - build:server
C
Chunwei 已提交
132

S
sangoly 已提交
133
build:mobile_model_mobilenetv1:
134 135 136 137
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
138

139
    script:
S
sangoly 已提交
140 141
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_mobilenetv1
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_mobilenetv1
142 143 144 145 146 147 148

    dependencies:
        - build:server

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
149
            - build.lite.android.armv8.gcc
150
            - ~/.ccache
S
sangoly 已提交
151
            - $CI_PROJECT_DIR/build_mobile_model_mobilenetv1
C
Chunwei 已提交
152

S
sangoly 已提交
153
build:mobile_model_mobilenetv2:
C
Chunwei 已提交
154 155 156 157
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
158

C
Chunwei 已提交
159
    script:
S
sangoly 已提交
160 161
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_mobilenetv2
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_mobilenetv2
162 163 164 165 166 167 168

    dependencies:
        - build:server

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
169
            - build.lite.android.armv8.gcc
170
            - ~/.ccache
S
sangoly 已提交
171
            - $CI_PROJECT_DIR/build_mobile_model_mobilenetv2
172

S
sangoly 已提交
173
build:mobile_model_resnet50:
174 175 176 177
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
178

179
    script:
S
sangoly 已提交
180 181
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_resnet50
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_resnet50
C
Chunwei 已提交
182

S
up  
superjomn 已提交
183 184
    dependencies:
        - build:server
C
Chunwei 已提交
185 186 187 188

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
189
            - build.lite.android.armv8.gcc
C
Chunwei 已提交
190
            - ~/.ccache
S
sangoly 已提交
191 192 193 194 195 196 197
            - $CI_PROJECT_DIR/build_mobile_model_resnet50

build:mobile_model_inceptionv4:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
198

S
sangoly 已提交
199 200 201 202 203 204 205 206 207 208 209 210 211
    script:
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_inceptionv4
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_inceptionv4

    dependencies:
        - build:server

    cache:
        key: mobile_thirdparty
        paths:
            - build.lite.android.armv8.gcc
            - ~/.ccache
            - $CI_PROJECT_DIR/build_mobile_model_inceptionv4