git
/
.gitlab-ci.yml
156 строк · 4.1 Кб
1default:2timeout: 2h3
4workflow:5rules:6- if: $CI_PIPELINE_SOURCE == "merge_request_event"7- if: $CI_COMMIT_TAG8- if: $CI_COMMIT_REF_PROTECTED == "true"9
10test:linux:11image: $image12variables:13CUSTOM_PATH: "/custom"14before_script:15- ./ci/install-dependencies.sh16script:17- useradd builder --create-home18- chown -R builder "${CI_PROJECT_DIR}"19- sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh20after_script:21- |22if test "$CI_JOB_STATUS" != 'success'
23then
24sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
25fi
26parallel:27matrix:28- jobname: linux-sha25629image: ubuntu:latest30CC: clang31- jobname: linux-reftable32image: ubuntu:latest33CC: clang34- jobname: linux-gcc35image: ubuntu:20.0436CC: gcc37CC_PACKAGE: gcc-838- jobname: linux-TEST-vars39image: ubuntu:20.0440CC: gcc41CC_PACKAGE: gcc-842- jobname: linux-gcc-default43image: ubuntu:latest44CC: gcc45- jobname: linux-leaks46image: ubuntu:latest47CC: gcc48- jobname: linux-reftable-leaks49image: ubuntu:latest50CC: gcc51- jobname: linux-asan-ubsan52image: ubuntu:latest53CC: clang54- jobname: pedantic55image: fedora:latest56- jobname: linux-musl57image: alpine:latest58artifacts:59paths:60- t/failed-test-artifacts61when: on_failure62
63test:osx:64image: $image65tags:66- saas-macos-medium-m167variables:68TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk"69before_script:70# Create a 4GB RAM disk that we use to store test output on. This small hack71# significantly speeds up tests by more than a factor of 2 because the72# macOS runners use network-attached storage as disks, which is _really_73# slow with the many small writes that our tests do.74- sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk75- ./ci/install-dependencies.sh76script:77- ./ci/run-build-and-tests.sh78after_script:79- |80if test "$CI_JOB_STATUS" != 'success'
81then
82./ci/print-test-failures.sh
83mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
84fi
85parallel:86matrix:87- jobname: osx-clang88image: macos-13-xcode-1489CC: clang90- jobname: osx-reftable91image: macos-13-xcode-1492CC: clang93artifacts:94paths:95- t/failed-test-artifacts96when: on_failure97
98test:fuzz-smoke-tests:99image: ubuntu:latest100variables:101CC: clang102before_script:103- ./ci/install-dependencies.sh104script:105- ./ci/run-build-and-minimal-fuzzers.sh106
107static-analysis:108image: ubuntu:22.04109variables:110jobname: StaticAnalysis111before_script:112- ./ci/install-dependencies.sh113script:114- ./ci/run-static-analysis.sh115- ./ci/check-directional-formatting.bash116
117check-whitespace:118image: ubuntu:latest119before_script:120- ./ci/install-dependencies.sh121# Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged122# pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should123# be defined in all pipelines.124script:125- |126R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
127./ci/check-whitespace.sh "$R"
128rules:129- if: $CI_PIPELINE_SOURCE == 'merge_request_event'130
131check-style:132image: ubuntu:latest133allow_failure: true134variables:135CC: clang136jobname: ClangFormat137before_script:138- ./ci/install-dependencies.sh139# Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged140# pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should141# be defined in all pipelines.142script:143- |144R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
145./ci/run-style-check.sh "$R"
146rules:147- if: $CI_PIPELINE_SOURCE == 'merge_request_event'148
149documentation:150image: ubuntu:latest151variables:152jobname: Documentation153before_script:154- ./ci/install-dependencies.sh155script:156- ./ci/test-documentation.sh157