GitLab Pipeline Sample Code
Without A-FOT
The sample code is as follows:
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
# After the installation is complete, the GCC for openEuler environment is available. The compilation commands are the same as those on other platforms.
- cd /home/test
# Run the original build script.
- sh build.sh
tags:
- kunpeng_c_builder_gcc # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
/home/test indicates the project file path. Replace it with the actual path.
With A-FOT (Configuration File Parameter Optimization)
The sample code is as follows:
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
# A-FOT directly calls the original build script.
a-fot --config_file a-fot.ini'
tags:
- kunpeng_c_builder_gcc # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
With A-FOT (Command Line Parameter Optimization)
The sample code is as follows:
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
a-fot --opt_mode AutoFDO --gcc_path /usr --run_script /root/run.sh --build_script /root/build.sh --build_mode Wrapper --work_path ./ --bin_file /tmp/test'
tags:
- kunpeng_c_builder_gcc # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
The optimization mode is AutoFDO, the GCC path is /usr, the application running script path is /root/run.sh, the application build script path is /root/build.sh, the build mode is Wrapper, and the script working directory is the current directory, and the executable binary path is /tmp/test. Replace them with the actual ones.
Parent topic: GCC for openEuler