]> Git Repo - buildroot-mgba.git/blob - .gitlab-ci.yml.in
package/rust: drop reference to HOST_RUST_JEMALLOC_CONF
[buildroot-mgba.git] / .gitlab-ci.yml.in
1 # Configuration for Gitlab-CI.
2 # Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines
3 # The .gitlab-ci.yml file is generated from .gitlab-ci.yml.in.
4 # It needs to be regenerated every time a defconfig is added, using
5 # "make .gitlab-ci.yml".
6
7 image: buildroot/base:20191027.2027
8
9 .check_base:
10     rules:
11         - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/ || $CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
12           when: never
13         - when: always
14
15 check-DEVELOPERS:
16     extends: .check_base
17     # get-developers should print just "No action specified"; if it prints
18     # anything else, it's a parse error.
19     # The initial ! is removed by YAML so we need to quote it.
20     script:
21         - "! utils/get-developers | grep -v 'No action specified'"
22
23 check-flake8:
24     extends: .check_base
25     before_script:
26         # Help flake8 to find the Python files without .py extension.
27         - find * -type f -name '*.py' > files.txt
28         - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
29         - sort -u files.txt | tee files.processed
30     script:
31         - python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
32     after_script:
33         - wc -l files.processed
34
35 check-gitlab-ci.yml:
36     extends: .check_base
37     script:
38         - mv .gitlab-ci.yml .gitlab-ci.yml.orig
39         - make .gitlab-ci.yml
40         - diff -u .gitlab-ci.yml.orig .gitlab-ci.yml
41
42 check-package:
43     extends: .check_base
44     script:
45         - make check-package
46
47 .defconfig_base:
48     script:
49         - echo "Configure Buildroot for ${DEFCONFIG_NAME}"
50         - make ${DEFCONFIG_NAME}
51         - echo 'Build buildroot'
52         - |
53             make > >(tee build.log |grep '>>>') 2>&1 || {
54                 echo 'Failed build last output'
55                 tail -200 build.log
56                 exit 1
57             }
58         - |
59             ./support/scripts/boot-qemu-image.py "${DEFCONFIG_NAME}" > >(tee runtime-test.log) 2>&1 || {
60                 echo 'Failed runtime test last output'
61                 tail -200 runtime-test.log
62                 exit 1
63             }
64     artifacts:
65         when: always
66         expire_in: 2 weeks
67         paths:
68             - .config
69             - build.log
70             - output/images/
71             - output/build/build-time.log
72             - output/build/packages-file-list.txt
73             - output/build/*/.config
74             - runtime-test.log
75
76 .defconfig:
77     extends: .defconfig_base
78     # Running the defconfigs for every push is too much, so limit to
79     # explicit triggers through the API.
80     rules:
81         # For tags, create a pipeline.
82         - if: '$CI_COMMIT_TAG'
83         # For pipeline created by using a trigger token.
84         - if: '$CI_PIPELINE_TRIGGERED'
85         # For the branch or tag name named *-defconfigs, create a pipeline.
86         - if: '$CI_COMMIT_REF_NAME =~ /^.*-defconfigs$/'
87     before_script:
88         - DEFCONFIG_NAME=${CI_JOB_NAME}
89
90 one-defconfig:
91     extends: .defconfig_base
92     rules:
93         # For the branch or tag name named *-*_defconfigs, create a pipeline.
94         - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/'
95     before_script:
96         - DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
97
98 .runtime_test_base:
99     # Keep build directories so the rootfs can be an artifact of the job. The
100     # runner will clean up those files for us.
101     # Multiply every emulator timeout by 10 to avoid sporadic failures in
102     # elastic runners.
103     script:
104         - echo "Starting runtime test ${TEST_CASE_NAME}"
105         - ./support/testing/run-tests -o test-output/ -d test-dl/ -k --timeout-multiplier 10 ${TEST_CASE_NAME}
106     artifacts:
107         when: always
108         expire_in: 2 weeks
109         paths:
110             - test-output/*.log
111             - test-output/*/.config
112             - test-output/*/images/*
113
114 .runtime_test:
115     extends: .runtime_test_base
116     # Running the runtime tests for every push is too much, so limit to
117     # explicit triggers through the API.
118     rules:
119         # For tags, create a pipeline.
120         - if: '$CI_COMMIT_TAG'
121         # For pipeline created by using a trigger token.
122         - if: '$CI_PIPELINE_TRIGGERED'
123         # For the branch or tag name named *-runtime-tests, create a pipeline.
124         - if: '$CI_COMMIT_REF_NAME =~ /^.*-runtime-tests$/'
125     before_script:
126         - TEST_CASE_NAME=${CI_JOB_NAME}
127
128 one-runtime_test:
129     extends: .runtime_test_base
130     rules:
131         - if: '$CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
132     before_script:
133         - TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
This page took 0.044495 seconds and 4 git commands to generate.