3 rules: # Only run this job when the Dockerfile is modified
5 - .gitlab-ci.d/opensbi.yml
6 - .gitlab-ci.d/opensbi/Dockerfile
13 IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
15 DOCKER_HOST: tcp://docker:2375
16 DOCKER_TLS_CERTDIR: ""
18 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
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
28 needs: ['docker-opensbi']
29 rules: # Only run this job when ...
30 - changes: # ... roms/opensbi/ is modified (submodule updated)
33 - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
35 - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
38 paths: # 'artifacts.zip' will contains the following files:
39 - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
40 - pc-bios/opensbi-riscv32-generic-fw_dynamic.elf
41 - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
42 - pc-bios/opensbi-riscv64-generic-fw_dynamic.elf
43 - opensbi32-generic-stdout.log
44 - opensbi32-generic-stderr.log
45 - opensbi64-generic-stdout.log
46 - opensbi64-generic-stderr.log
47 image: $CI_REGISTRY_IMAGE:opensbi-cross-build
50 script: # Clone the required submodules and build OpenSBI
51 - git submodule update --init roms/opensbi
52 - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
53 - echo "=== Using ${JOBS} simultaneous jobs ==="
54 - make -j${JOBS} -C roms/opensbi clean
55 - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2
56 - make -j${JOBS} -C roms/opensbi clean
57 - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2