xref: /openbmc/qemu/.gitlab-ci.d/opensbi.yml (revision 1f42e246)
1docker-opensbi:
2 stage: containers
3 rules: # Only run this job when the Dockerfile is modified
4 - changes:
5   - .gitlab-ci.d/opensbi.yml
6   - .gitlab-ci.d/opensbi/Dockerfile
7   when: always
8 image: docker:19.03.1
9 services:
10 - docker:19.03.1-dind
11 variables:
12  GIT_DEPTH: 3
13  IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
14  # We don't use TLS
15  DOCKER_HOST: tcp://docker:2375
16  DOCKER_TLS_CERTDIR: ""
17 before_script:
18 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
19 script:
20 - docker pull $IMAGE_TAG || true
21 - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
22                                        --tag $IMAGE_TAG .gitlab-ci.d/opensbi
23 - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
24 - docker push $IMAGE_TAG
25
26build-opensbi:
27 stage: build
28 rules: # Only run this job when ...
29 - changes: # ... roms/opensbi/ is modified (submodule updated)
30   - roms/opensbi/*
31   when: always
32 - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
33   when: always
34 - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
35   when: always
36 artifacts:
37   paths: # 'artifacts.zip' will contains the following files:
38   - pc-bios/opensbi-riscv32-sifive_u-fw_jump.bin
39   - pc-bios/opensbi-riscv32-virt-fw_jump.bin
40   - pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
41   - pc-bios/opensbi-riscv64-virt-fw_jump.bin
42   - opensbi32-virt-stdout.log
43   - opensbi32-virt-stderr.log
44   - opensbi64-virt-stdout.log
45   - opensbi64-virt-stderr.log
46   - opensbi32-sifive_u-stdout.log
47   - opensbi32-sifive_u-stderr.log
48   - opensbi64-sifive_u-stdout.log
49   - opensbi64-sifive_u-stderr.log
50 image: $CI_REGISTRY_IMAGE:opensbi-cross-build
51 variables:
52   GIT_DEPTH: 3
53 script: # Clone the required submodules and build OpenSBI
54 - git submodule update --init roms/opensbi
55 - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
56 - echo "=== Using ${JOBS} simultaneous jobs ==="
57 - make -j${JOBS} -C roms/opensbi clean
58 - make -j${JOBS} -C roms opensbi32-virt 2>&1 1>opensbi32-virt-stdout.log | tee -a opensbi32-virt-stderr.log >&2
59 - make -j${JOBS} -C roms/opensbi clean
60 - make -j${JOBS} -C roms opensbi64-virt 2>&1 1>opensbi64-virt-stdout.log | tee -a opensbi64-virt-stderr.log >&2
61 - make -j${JOBS} -C roms/opensbi clean
62 - make -j${JOBS} -C roms opensbi32-sifive_u 2>&1 1>opensbi32-sifive_u-stdout.log | tee -a opensbi32-sifive_u-stderr.log >&2
63 - make -j${JOBS} -C roms/opensbi clean
64 - 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