中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

Gitlab流水线代码示例

提供扫描、编译、测试、调优相关能力的Gitlab流水线代码示例。
stages:  
  - migrating-applications
  - affinity-analysis
  - build
  - test
source-code-scanning:
  stage: migrating-applications
  tags:
    - kunpeng_scanner
  script:
    - echo '====== 源码迁移 ======' 
    - devkit porting src-mig -i ./ -c make -r html || [ $? -eq 1 ] && echo 0
    - mv ./src*.html ./SourceCodeScanningReport.html
  artifacts:
    paths:
      - SourceCodeScanningReport.html
    name: src-mig
byte-alignment-check:
  stage: affinity-analysis
  tags:
    - kunpeng_scanner # 对应gitlab-runner注册时的标签,可选择多个
  script:
    - echo '====== 字节对齐检查 ======'
    - devkit advisor byte-align -i ./ -c make -b make -r html
    - mv ./byte-align*.html ./byte-alignment-check.html
  artifacts:
    paths:
      - byte-alignment-check.html
    name: byte-align
64-bit-running-mode-check:
  stage: affinity-analysis
  tags:
    - kunpeng_scanner # 对应gitlab-runner注册时的标签,可选择多个
  script:
    - echo '====== 64位运行模式检查 ======'
    - devkit advisor mode-check -i ./ -r html
    - mv ./mode_check*.html ./64-bit-running-mode-check.html
  artifacts:
    paths:
      - 64-bit-running-mode-check.html
    name: mode-check
compiles:
  stage: build
  tags:
    - kunpeng_scanner
  script:
    - cd ./
    - chmod 777 *
    - make -j
a-fot:
  stage: build
  tags:
    - kunpeng_scanner
  script:
    - pwd
    - chmod 777 *
    - /tmp/A-FOT-master/a-fot  --opt_mode AutoFDO --build_script $(pwd)/build.sh --run_script $(pwd)/run.sh --app_name func001  --build_mode Wrapper --max_waiting_time 30 --bin_file /tmp/test
lkp-test:       # This job runs in the build stage, which runs first.
  stage: test
  script:
    - CURDIR=$(pwd)
    - cd ./
    - chmod 777 *
    - make -j
    - echo $CURDIR
    - cp -rf /root/.local/compatibility_testing/template.html.bak /root/.local/compatibility_testing/template.html
    - sudo /root/.local/lkp-tests/bin/lkp run /root/.local/lkp-tests/programs/compatibility-test/compatibility-test-defaults.yaml
    - cp -rf /root/.local/compatibility_testing/compatibility_report.html $CURDIR/compatibility_report.html
    - sudo sh /root/.local/compatibility_testing/report_result.sh
    - echo "请去 '${CURDIR}'/compatibility_report.html 查看报告 "
  artifacts:   
    paths:
      - compatibility_report.html
    name: compatibility_report
  tags:
    - kunpeng_scanner # 对应gitlab-runner注册时的标签,可选择多个