]>
Commit | Line | Data |
---|---|---|
ac0595cf PMD |
1 | # All jobs needing docker-edk2 must use the same rules it uses. |
2 | .edk2_job_rules: | |
37a2b952 | 3 | rules: |
6e131bf6 DB |
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"' | |
6 | when: never | |
7 | ||
8 | # In forks, if QEMU_CI=1 is set, then create manual job | |
9 | # if any of the files affecting the build are touched | |
10 | - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project"' | |
11 | changes: | |
12 | - .gitlab-ci.d/edk2.yml | |
13 | - .gitlab-ci.d/edk2/Dockerfile | |
14 | - roms/edk2/* | |
15 | when: manual | |
16 | ||
17 | # In forks, if QEMU_CI=1 is set, then create manual job | |
18 | # if the branch/tag starts with 'edk2' | |
19 | - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_REF_NAME =~ /^edk2/' | |
20 | when: manual | |
21 | ||
22 | # In forks, if QEMU_CI=1 is set, then create manual job | |
23 | # if last commit msg contains 'EDK2' (case insensitive) | |
24 | - if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE != "qemu-project" && $CI_COMMIT_MESSAGE =~ /edk2/i' | |
25 | when: manual | |
26 | ||
37a2b952 | 27 | # Run if any files affecting the build output are touched |
94b73187 | 28 | - changes: |
94b73187 | 29 | - .gitlab-ci.d/edk2.yml |
94b73187 | 30 | - .gitlab-ci.d/edk2/Dockerfile |
94b73187 DB |
31 | - roms/edk2/* |
32 | when: on_success | |
37a2b952 DB |
33 | |
34 | # Run if the branch/tag starts with 'edk2' | |
35 | - if: '$CI_COMMIT_REF_NAME =~ /^edk2/' | |
94b73187 | 36 | when: on_success |
37a2b952 DB |
37 | |
38 | # Run if last commit msg contains 'EDK2' (case insensitive) | |
39 | - if: '$CI_COMMIT_MESSAGE =~ /edk2/i' | |
94b73187 | 40 | when: on_success |
ac0595cf PMD |
41 | |
42 | docker-edk2: | |
94b73187 DB |
43 | extends: .edk2_job_rules |
44 | stage: containers | |
45 | image: docker:19.03.1 | |
46 | services: | |
47 | - docker:19.03.1-dind | |
48 | variables: | |
49 | GIT_DEPTH: 3 | |
50 | IMAGE_TAG: $CI_REGISTRY_IMAGE:edk2-cross-build | |
51 | # We don't use TLS | |
52 | DOCKER_HOST: tcp://docker:2375 | |
53 | DOCKER_TLS_CERTDIR: "" | |
54 | before_script: | |
55 | - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY | |
56 | script: | |
57 | - docker pull $IMAGE_TAG || true | |
58 | - docker build --cache-from $IMAGE_TAG --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA | |
59 | --tag $IMAGE_TAG .gitlab-ci.d/edk2 | |
60 | - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA | |
61 | - docker push $IMAGE_TAG | |
71920809 PMD |
62 | |
63 | build-edk2: | |
94b73187 DB |
64 | extends: .edk2_job_rules |
65 | stage: build | |
66 | needs: ['docker-edk2'] | |
67 | artifacts: | |
68 | paths: # 'artifacts.zip' will contains the following files: | |
69 | - pc-bios/edk2*bz2 | |
70 | - pc-bios/edk2-licenses.txt | |
71 | - edk2-stdout.log | |
72 | - edk2-stderr.log | |
73 | image: $CI_REGISTRY_IMAGE:edk2-cross-build | |
74 | variables: | |
75 | GIT_DEPTH: 3 | |
76 | script: # Clone the required submodules and build EDK2 | |
77 | - git submodule update --init roms/edk2 | |
78 | - git -C roms/edk2 submodule update --init -- | |
79 | ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 | |
80 | BaseTools/Source/C/BrotliCompress/brotli | |
81 | CryptoPkg/Library/OpensslLib/openssl | |
82 | MdeModulePkg/Library/BrotliCustomDecompressLib/brotli | |
83 | - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1)) | |
84 | - echo "=== Using ${JOBS} simultaneous jobs ===" | |
85 | - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2 |