master
yml 133 lines 4.03 KB
Raw
1
2 .native_build_job_template:
3 extends: .base_meson_ccache_job_template
4 stage: build
5 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
6 script:
7 - !reference [.base_meson_ccache_job_template, script]
8 - du -sh .git
9 - mkdir build
10 - cd build
11 - section_start configure "Running configure"
12 - ../configure --enable-werror --disable-docs --enable-fdt=system
13 --disable-debug-info
14 ${TARGETS:+--target-list="$TARGETS"}
15 $CONFIGURE_ARGS ||
16 { cat config.log meson-logs/meson-log.txt && exit 1; }
17 - if test -n "$LD_JOBS";
18 then
19 pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
20 fi || exit 1;
21 - section_end configure
22 - section_start build "Building QEMU"
23 - $MAKE -j"$JOBS"
24 - section_end build
25 - section_start test "Running tests"
26 - if test -n "$MAKE_CHECK_ARGS";
27 then
28 $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
29 fi
30 - section_end test
31
32 # We jump some hoops in common_test_job_template to avoid
33 # rebuilding all the object files we skip in the artifacts
34 .native_build_artifact_template:
35 artifacts:
36 when: on_success
37 expire_in: 2 days
38 paths:
39 - build
40 - .git-submodule-status
41 - ci-runner-env
42 exclude:
43 - build/**/*.p
44 - build/**/*.a.p
45 - build/**/*.c.o
46 - build/**/*.c.o.d
47
48 .common_test_job_template:
49 extends: .base_meson_job_template
50 stage: test
51 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
52 artifacts:
53 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
54 when: always
55 expire_in: 7 days
56 paths:
57 - build/meson-logs
58 - build/tests/functional/*/*/*.log
59 reports:
60 junit: build/meson-logs/*.junit.xml
61 script:
62 - source scripts/ci/gitlab-ci-section
63 - section_start buildenv "Setting up to run tests"
64 - scripts/git-submodule.sh update roms/SLOF
65 - build/pyvenv/bin/meson subprojects download $(cd build/subprojects && echo *)
66 - cd build
67 - find . -type f -exec touch {} +
68 # Avoid recompiling by hiding ninja with NINJA=":"
69 # We also have to pre-cache the functional tests manually in this case
70 - if [ "x${QEMU_TEST_CACHE_DIR}" != "x" ]; then
71 $MAKE precache-functional ;
72 fi
73 - section_end buildenv
74 - section_start test "Running tests"
75 # doctests need all the compilation artifacts
76 - $MAKE NINJA=":" MTESTARGS="--no-suite doc" $MAKE_CHECK_ARGS
77 - section_end test
78
79 .native_test_job_template:
80 extends: .common_test_job_template
81
82 .functional_test_job_template:
83 extends: .common_test_job_template
84 cache:
85 key: "${CI_JOB_NAME}-cache"
86 paths:
87 - ${CI_PROJECT_DIR}/functional-cache
88 policy: pull-push
89 before_script:
90 - export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
91 - export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
92 # Prevent logs from the build job that run earlier
93 # from being duplicated in the test job artifacts
94 - rm -f build/meson-logs/*
95 artifacts:
96 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
97 when: always
98 expire_in: 7 days
99 paths:
100 - build/meson-logs
101 - build/tests/functional/*/*/*.log
102 - ci-runner-env
103 reports:
104 junit: build/meson-logs/*.junit.xml
105 after_script:
106 - cd build
107 - du -chs ${CI_PROJECT_DIR}/*-cache
108 variables:
109 QEMU_JOB_FUNCTIONAL: 1
110 QEMU_TEST_ALLOW_UNTRUSTED_CODE: 1
111 QEMU_TEST_CACHE_DIR: ${CI_PROJECT_DIR}/functional-cache
112
113 .wasm_build_job_template:
114 extends: .base_meson_job_template
115 stage: build
116 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
117 script:
118 - du -sh .git
119 - mkdir build
120 - cd build
121 - section_start configure "Running configure"
122 - emconfigure ../configure --disable-docs
123 ${TARGETS:+--target-list="$TARGETS"}
124 $CONFIGURE_ARGS ||
125 { cat config.log meson-logs/meson-log.txt && exit 1; }
126 - if test -n "$LD_JOBS";
127 then
128 pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
129 fi || exit 1;
130 - section_end configure
131 - section_start build "Building QEMU"
132 - emmake make -j"$JOBS"
133 - section_end build