.gitlab-ci.yml 4.9 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 15 16 17 18
  # 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"
  - git fetch origin incubate/lite
  - git merge --no-ff origin/incubate/lite


S
superjomn 已提交
19 20 21 22
image: $SERVER_LITE_DOCKER_IMAGE

stages:
  - ci
S
up  
superjomn 已提交
23 24
  - build_server
  - build_mobile
S
superjomn 已提交
25 26

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

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

S
superjomn 已提交
38 39 40
    cache:
        key: check_style
        paths:
C
Chunwei 已提交
41
            - $CI_USER_DIR/.cache
S
superjomn 已提交
42 43

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

C
Chunwei 已提交
71 72 73 74 75 76 77 78
build:mobile_android:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
79 80
            - build.lite.android.armv8.gcc/third_party
            - build.lite.android.armv7.gcc/third_party
C
Chunwei 已提交
81 82 83 84 85 86 87 88 89 90 91
            - ~/.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


build:mobile_armlinux:
S
fix ci  
superjomn 已提交
92 93
    tags:
        - lite
S
up  
superjomn 已提交
94
    stage: build_mobile
S
superjomn 已提交
95
    image: $MOBILE_LITE_DOCKER_IMAGE
S
up  
superjomn 已提交
96 97 98
    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
99 100 101
            - build.lite.armlinux.armv8.gcc
            - build.lite.armlinux.armv7.gcc
            - build.lite.armlinux.armv7hf.gcc
C
Chunwei 已提交
102
            - ~/.ccache
C
Chunwei 已提交
103
            - $CI_PROJECT_DIR/build_mobile_ccache2
S
superjomn 已提交
104
    script:
C
Chunwei 已提交
105 106 107 108 109
        - 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 已提交
110

C
Chunwei 已提交
111

112 113 114 115 116
build:mobile_model_mobilenetv1:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
117

118 119 120 121 122 123 124 125 126 127
    script:
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_mobilenetv1
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_mobilenetv1

    dependencies:
        - build:server

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
128
            - build.lite.android.armv8.gcc
129 130 131
            - ~/.ccache
            - $CI_PROJECT_DIR/build_mobile_model_mobilenetv1

C
Chunwei 已提交
132 133 134 135 136
build:mobile_model_mobilenetv2:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
137

C
Chunwei 已提交
138
    script:
139 140 141 142 143 144 145 146 147
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_mobilenetv2
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_mobilenetv2

    dependencies:
        - build:server

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
148
            - build.lite.android.armv8.gcc
149 150 151 152 153 154 155 156
            - ~/.ccache
            - $CI_PROJECT_DIR/build_mobile_model_mobilenetv2

build:mobile_model_resnet50:
    tags:
        - lite
    stage: build_mobile
    image: $MOBILE_LITE_DOCKER_IMAGE
C
Chunwei 已提交
157

158 159 160
    script:
        - export CCACHE_DIR=$CI_PROJECT_DIR/build_mobile_model_resnet50
        - ./paddle/fluid/lite/tools/build.sh build_test_arm_model_resnet50
C
Chunwei 已提交
161

S
up  
superjomn 已提交
162 163
    dependencies:
        - build:server
C
Chunwei 已提交
164 165 166 167

    cache:
        key: mobile_thirdparty
        paths:
S
superjomn 已提交
168
            - build.lite.android.armv8.gcc
C
Chunwei 已提交
169
            - ~/.ccache
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
            - $CI_PROJECT_DIR/build_mobile_model_resnet50

#build:mobile_model_inceptionv4:
#    tags:
#        - lite
#    stage: build_mobile
#    image: $MOBILE_LITE_DOCKER_IMAGE
#    cache:
#        key: mobile_thirdparty
#        paths:
#            - $MOBILE_LITE_CACHE0
#            - $MOBILE_LITE_CACHE1
#            - ~/.ccache
#    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:
#            - $MOBILE_LITE_CACHE0
#            - $MOBILE_LITE_CACHE1
#            - ~/.ccache
#            - $CI_PROJECT_DIR/build_mobile_model_inceptionv4