xref: /openbmc/qemu/.gitlab-ci.d/cirrus/build.yml (revision d3860a57)
1@CIRRUS_VM_INSTANCE_TYPE@:
2  @CIRRUS_VM_IMAGE_SELECTOR@: @CIRRUS_VM_IMAGE_NAME@
3  cpu: @CIRRUS_VM_CPUS@
4  memory: @CIRRUS_VM_RAM@
5
6env:
7  CIRRUS_CLONE_DEPTH: 1
8  CI_REPOSITORY_URL: "@CI_REPOSITORY_URL@"
9  CI_COMMIT_REF_NAME: "@CI_COMMIT_REF_NAME@"
10  CI_COMMIT_SHA: "@CI_COMMIT_SHA@"
11  PATH: "@PATH@"
12  PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
13  PYTHON: "@PYTHON@"
14  MAKE: "@MAKE@"
15  CONFIGURE_ARGS: "@CONFIGURE_ARGS@"
16  TEST_TARGETS: "@TEST_TARGETS@"
17
18build_task:
19  install_script:
20    - @UPDATE_COMMAND@
21    - @INSTALL_COMMAND@ @PKGS@
22    - if test -n "@PYPI_PKGS@" ; then @PIP3@ install @PYPI_PKGS@ ; fi
23  clone_script:
24    - git clone --depth 100 "$CI_REPOSITORY_URL" .
25    - git fetch origin "$CI_COMMIT_REF_NAME"
26    - git reset --hard "$CI_COMMIT_SHA"
27  build_script:
28    - mkdir build
29    - cd build
30    - ../configure --enable-werror $CONFIGURE_ARGS
31      || { cat config.log meson-logs/meson-log.txt; exit 1; }
32    - $MAKE -j$(sysctl -n hw.ncpu)
33    - for TARGET in $TEST_TARGETS ;
34      do
35        $MAKE -j$(sysctl -n hw.ncpu) $TARGET V=1 ;
36      done
37  always:
38    build_result_artifacts:
39      path: build/meson-logs/*log.txt
40      type: text/plain
41