1spec: 2 inputs: 3 target: 4 description: 5 Build target in form of "OS-ARCH" pair (e.g., linux-amd64). Mostly the 6 same as platform string for Docker but with a hyphen instead of slash. 7 toolchain: 8 description: 9 An array of toolchains to test with. Each toolchain should have an 10 appropriate Meson cross file. 11 type: array 12 default: [gnu, llvm] 13 qemu_cpu: 14 description: 15 QEMU_CPU environmental variable used by Docker (which uses QEMU 16 underneath). It is not used by x86 targets, as they are executed 17 natively on the host. 18 default: "" 19 enable_gnu_coverage: 20 description: 21 Enable coverage build flags. It can be later used to compile a coverage 22 report for all the jobs. Should be enabled only for native build 23 environments as they have all the optional dependencies, and are the 24 most reliable and uniform (so disable for cross environments). 25 type: boolean 26 default: true 27 job_name_prefix: 28 description: 29 Additional prefix for the job name. Can be used to disable a job with a 30 "." prefix. 31 default: "" 32 job_name_suffix: 33 description: 34 Additional suffix for the job name. Can be used to prevent job 35 duplication for jobs for the same target. 36 default: "" 37 allow_failure: 38 description: 39 Set the `allow_failure` flag for jobs that are expected to fail. 40 Remember to set `retry` argument to 0 to prevent unnecessary retries. 41 type: boolean 42 default: false 43 retry: 44 description: 45 Set the `retry` flag for a job. Usually used together with 46 `allow_failure`. 47 type: number 48 default: 1 49 runner_tags: 50 description: List of GitLab runner tags for this job. 51 type: array 52 default: [] 53 docker_job: 54 description: Docker image build job name. 55 default: docker 56--- 57 58"$[[ inputs.job_name_prefix ]]build:$[[ inputs.target ]]$[[ inputs.job_name_suffix ]]": 59 extends: .target:all 60 tags: $[[ inputs.runner_tags ]] 61 stage: build 62 allow_failure: $[[ inputs.allow_failure ]] 63 retry: $[[ inputs.retry ]] 64 needs: 65 - job: $[[ inputs.docker_job | expand_vars ]] 66 optional: true 67 parallel: 68 matrix: 69 - TARGET: $[[ inputs.target ]] 70 variables: 71 TARGET: $[[ inputs.target ]] 72 QEMU_CPU: $[[ inputs.qemu_cpu ]] 73 parallel: 74 matrix: 75 - TOOLCHAIN: $[[ inputs.toolchain ]] 76 script: 77 - | 78 if [ "$[[ inputs.enable_gnu_coverage ]]" == "true" ] && [ "${TOOLCHAIN}" == "gnu" ]; then 79 COV_C_ARGS=-fprofile-update=atomic 80 COV_MESON_BUILD_ARGS=-Db_coverage=true 81 mkdir -p ${BUILD_DIR} 82 touch ${BUILD_DIR}/.coverage-enable 83 fi 84 - meson setup ${BUILD_DIR} 85 --cross-file .gitlab-ci.d/meson-cross/${TARGET}-${TOOLCHAIN}.meson 86 -Dc_args="${COV_C_ARGS}" ${COV_MESON_BUILD_ARGS} 87 - meson compile -C ${BUILD_DIR} 88 artifacts: 89 when: always 90 paths: 91 - ${BUILD_DIR}/ 92