1 # All jobs needing docker-opensbi must use the same rules it uses.
4 # Forks don't get pipelines unless QEMU_CI=1 or QEMU_CI=2 is set
5 - if: '$QEMU_CI != "1" && $QEMU_CI != "2" && $CI_PROJECT_NAMESPACE != "qemu-project"'
8 # In forks, if QEMU_CI=1 is set, then create manual job
9 # if any files affecting the build output are touched
10 - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project"'
12 - .gitlab-ci.d/opensbi.yml
13 - .gitlab-ci.d/opensbi/Dockerfile
17 # In forks, if QEMU_CI=1 is set, then create manual job
18 # if the branch/tag starts with 'opensbi'
19 - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_REF_NAME =~ /^opensbi/'
22 # In forks, if QEMU_CI=1 is set, then create manual job
23 # if the last commit msg contains 'OpenSBI' (case insensitive)
24 - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_MESSAGE =~ /opensbi/i'
27 # Scheduled runs on mainline don't get pipelines except for the special Coverity job
28 - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
31 # Run if any files affecting the build output are touched
33 - .gitlab-ci.d/opensbi.yml
34 - .gitlab-ci.d/opensbi/Dockerfile
38 # Run if the branch/tag starts with 'opensbi'
39 - if: '$CI_COMMIT_REF_NAME =~ /^opensbi/'
42 # Run if the last commit msg contains 'OpenSBI' (case insensitive)
43 - if: '$CI_COMMIT_MESSAGE =~ /opensbi/i'
47 extends: .opensbi_job_rules
54 IMAGE_TAG: $CI_REGISTRY_IMAGE:opensbi-cross-build
56 - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
57 - until docker info; do sleep 1; done
59 - docker pull $IMAGE_TAG || true
60 - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
61 --tag $IMAGE_TAG .gitlab-ci.d/opensbi
62 - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
63 - docker push $IMAGE_TAG
66 extends: .opensbi_job_rules
68 needs: ['docker-opensbi']
71 paths: # 'artifacts.zip' will contains the following files:
72 - pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
73 - pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
74 - opensbi32-generic-stdout.log
75 - opensbi32-generic-stderr.log
76 - opensbi64-generic-stdout.log
77 - opensbi64-generic-stderr.log
78 image: $CI_REGISTRY_IMAGE:opensbi-cross-build
81 script: # Clone the required submodules and build OpenSBI
82 - git submodule update --init roms/opensbi
83 - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
84 - echo "=== Using ${JOBS} simultaneous jobs ==="
85 - make -j${JOBS} -C roms/opensbi clean
86 - make -j${JOBS} -C roms opensbi32-generic 2>&1 1>opensbi32-generic-stdout.log | tee -a opensbi32-generic-stderr.log >&2
87 - make -j${JOBS} -C roms/opensbi clean
88 - make -j${JOBS} -C roms opensbi64-generic 2>&1 1>opensbi64-generic-stdout.log | tee -a opensbi64-generic-stderr.log >&2