1 # All jobs needing docker-opensbi must use the same rules it uses.
3 rules: # Only run this job when ...
5 # this file is modified
6 - .gitlab-ci.d/opensbi.yml
7 # or the Dockerfile is modified
8 - .gitlab-ci.d/opensbi/Dockerfile
10 - changes: # or roms/opensbi/ is modified (submodule updated)
13 - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
15 - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
19 extends: .opensbi_job_rules
26 IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
28 DOCKER_HOST: tcp://docker:2375
29 DOCKER_TLS_CERTDIR: ""
31 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
33 - docker pull $IMAGE_TAG || true
34 - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
35 --tag $IMAGE_TAG .gitlab-ci.d/opensbi
36 - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
37 - docker push $IMAGE_TAG
40 extends: .opensbi_job_rules
42 needs: ['docker-opensbi']
44 paths: # 'artifacts.zip' will contains the following files:
45 - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
46 - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
47 - opensbi32-generic-stdout.log
48 - opensbi32-generic-stderr.log
49 - opensbi64-generic-stdout.log
50 - opensbi64-generic-stderr.log
51 image: $CI_REGISTRY_IMAGE:opensbi-cross-build
54 script: # Clone the required submodules and build OpenSBI
55 - git submodule update --init roms/opensbi
56 - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
57 - echo "=== Using ${JOBS} simultaneous jobs ==="
58 - make -j${JOBS} -C roms/opensbi clean
59 - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2
60 - make -j${JOBS} -C roms/opensbi clean
61 - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2