# 定义 stages stages: - build - test # 定义 job job_test: stage: test script: - echo program test start at `date +"%Y/%m/%d, %H:%M:%S"` >> /tmp/ci_auto_test.log - cd test - chmod +x test_hello_ci_world - ./test_hello_ci_world # 定义 job job_build: stage: build script: - rm -f test/test_hello_ci_world - mkdir -p build - rm -rf build/* - cd build - cmake .. - make - make install - cd .. - echo program build start at `date +"%Y/%m/%d, %H:%M:%S"` >> /tmp/ci_auto_build.log artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - ./build/* - ./test/*