xref: /openbmc/qemu/.gitlab-ci.d/opensbi.yml (revision d0caa0a8813d474749f4cac4ed7029b142a82189)
1922febe2SThomas Huthdocker-opensbi:
2*d0caa0a8SDaniel P. Berrangé stage: containers
3922febe2SThomas Huth rules: # Only run this job when the Dockerfile is modified
4922febe2SThomas Huth - changes:
55117ba25SThomas Huth   - .gitlab-ci.d/opensbi.yml
6922febe2SThomas Huth   - .gitlab-ci.d/opensbi/Dockerfile
7922febe2SThomas Huth   when: always
8922febe2SThomas Huth image: docker:19.03.1
9922febe2SThomas Huth services:
10922febe2SThomas Huth - docker:19.03.1-dind
11922febe2SThomas Huth variables:
12922febe2SThomas Huth  GIT_DEPTH: 3
13922febe2SThomas Huth  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
14922febe2SThomas Huth  # We don't use TLS
15922febe2SThomas Huth  DOCKER_HOST: tcp://docker:2375
16922febe2SThomas Huth  DOCKER_TLS_CERTDIR: ""
17922febe2SThomas Huth before_script:
18922febe2SThomas Huth - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
19922febe2SThomas Huth script:
20922febe2SThomas Huth - docker pull $IMAGE_TAG || true
21922febe2SThomas Huth - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
22922febe2SThomas Huth                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
23922febe2SThomas Huth - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
24922febe2SThomas Huth - docker push $IMAGE_TAG
25922febe2SThomas Huth
26922febe2SThomas Huthbuild-opensbi:
27*d0caa0a8SDaniel P. Berrangé stage: build
28922febe2SThomas Huth rules: # Only run this job when ...
29922febe2SThomas Huth - changes: # ... roms/opensbi/ is modified (submodule updated)
30922febe2SThomas Huth   - roms/opensbi/*
31922febe2SThomas Huth   when: always
32922febe2SThomas Huth - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
33922febe2SThomas Huth   when: always
34922febe2SThomas Huth - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
35922febe2SThomas Huth   when: always
36922febe2SThomas Huth artifacts:
37922febe2SThomas Huth   paths: # 'artifacts.zip' will contains the following files:
38922febe2SThomas Huth   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
39922febe2SThomas Huth   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
40922febe2SThomas Huth   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
41922febe2SThomas Huth   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
42922febe2SThomas Huth   - opensbi32-virt-stdout.log
43922febe2SThomas Huth   - opensbi32-virt-stderr.log
44922febe2SThomas Huth   - opensbi64-virt-stdout.log
45922febe2SThomas Huth   - opensbi64-virt-stderr.log
46922febe2SThomas Huth   - opensbi32-sifive_u-stdout.log
47922febe2SThomas Huth   - opensbi32-sifive_u-stderr.log
48922febe2SThomas Huth   - opensbi64-sifive_u-stdout.log
49922febe2SThomas Huth   - opensbi64-sifive_u-stderr.log
50922febe2SThomas Huth image: $CI_REGISTRY_IMAGE:opensbi-cross-build
51922febe2SThomas Huth variables:
52922febe2SThomas Huth   GIT_DEPTH: 3
53922febe2SThomas Huth script: # Clone the required submodules and build OpenSBI
54922febe2SThomas Huth - git submodule update --init roms/opensbi
55922febe2SThomas Huth - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
56922febe2SThomas Huth - echo "=== Using ${JOBS} simultaneous jobs ==="
57922febe2SThomas Huth - make -j${JOBS} -C roms/opensbi clean
58922febe2SThomas Huth - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
59922febe2SThomas Huth - make -j${JOBS} -C roms/opensbi clean
60922febe2SThomas Huth - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
61922febe2SThomas Huth - make -j${JOBS} -C roms/opensbi clean
62922febe2SThomas Huth - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
63922febe2SThomas Huth - make -j${JOBS} -C roms/opensbi clean
64922febe2SThomas Huth - make -j${JOBS} -C roms opensbi64-sifive_u 2>&1 1>opensbi64-sifive_u-stdout.log | tee -a opensbi64-sifive_u-stderr.log >&2
65