Git fork
at reftables-rust 271 lines 7.0 kB view raw
1default: 2 timeout: 2h 3 4stages: 5 - build 6 - test 7 - analyze 8 9workflow: 10 rules: 11 - if: $CI_PIPELINE_SOURCE == "merge_request_event" 12 - if: $CI_COMMIT_TAG 13 - if: $CI_COMMIT_REF_PROTECTED == "true" 14 15test:linux: 16 image: $image 17 stage: test 18 needs: [ ] 19 tags: 20 - saas-linux-medium-amd64 21 variables: 22 CUSTOM_PATH: "/custom" 23 TEST_OUTPUT_DIRECTORY: "/tmp/test-output" 24 before_script: 25 - ./ci/install-dependencies.sh 26 script: 27 - useradd builder --create-home 28 - chown -R builder "${CI_PROJECT_DIR}" 29 - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh 30 after_script: 31 - | 32 if test "$CI_JOB_STATUS" != 'success' 33 then 34 sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh 35 mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/ 36 fi 37 parallel: 38 matrix: 39 - jobname: linux-sha256 40 image: ubuntu:rolling 41 CC: clang 42 - jobname: linux-reftable 43 image: ubuntu:rolling 44 CC: clang 45 - jobname: linux-breaking-changes 46 image: ubuntu:20.04 47 CC: gcc 48 - jobname: fedora-breaking-changes-meson 49 image: fedora:latest 50 - jobname: linux-TEST-vars 51 image: ubuntu:20.04 52 CC: gcc 53 CC_PACKAGE: gcc-8 54 - jobname: linux-leaks 55 image: ubuntu:rolling 56 CC: gcc 57 - jobname: linux-reftable-leaks 58 image: ubuntu:rolling 59 CC: gcc 60 - jobname: linux-asan-ubsan 61 image: ubuntu:rolling 62 CC: clang 63 - jobname: linux-musl-meson 64 image: alpine:latest 65 - jobname: linux32 66 image: i386/ubuntu:20.04 67 - jobname: linux-meson 68 image: ubuntu:rolling 69 CC: gcc 70 artifacts: 71 paths: 72 - t/failed-test-artifacts 73 reports: 74 junit: build/meson-logs/testlog.junit.xml 75 when: on_failure 76 77test:osx: 78 image: $image 79 stage: test 80 needs: [ ] 81 tags: 82 - saas-macos-medium-m1 83 variables: 84 TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk" 85 before_script: 86 # Create a 4GB RAM disk that we use to store test output on. This small hack 87 # significantly speeds up tests by more than a factor of 2 because the 88 # macOS runners use network-attached storage as disks, which is _really_ 89 # slow with the many small writes that our tests do. 90 - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk 91 - ./ci/install-dependencies.sh 92 script: 93 - ./ci/run-build-and-tests.sh 94 after_script: 95 - | 96 if test "$CI_JOB_STATUS" != 'success' 97 then 98 ./ci/print-test-failures.sh 99 mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/ 100 fi 101 parallel: 102 matrix: 103 - jobname: osx-clang 104 image: macos-14-xcode-15 105 CC: clang 106 - jobname: osx-reftable 107 image: macos-14-xcode-15 108 CC: clang 109 - jobname: osx-meson 110 image: macos-14-xcode-15 111 CC: clang 112 artifacts: 113 paths: 114 - t/failed-test-artifacts 115 reports: 116 junit: build/meson-logs/testlog.junit.xml 117 when: on_failure 118 119.windows_before_script: &windows_before_script 120 # Disabling realtime monitoring fails on some of the runners, but it 121 # significantly speeds up test execution in the case where it works. We thus 122 # try our luck, but ignore any failures. 123 - Set-MpPreference -DisableRealtimeMonitoring $true; $true 124 125build:mingw64: 126 stage: build 127 tags: 128 - saas-windows-medium-amd64 129 variables: 130 NO_PERL: 1 131 before_script: 132 - *windows_before_script 133 - ./ci/install-sdk.ps1 -directory "git-sdk" 134 script: 135 - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts' 136 artifacts: 137 paths: 138 - artifacts 139 - git-sdk 140 141test:mingw64: 142 stage: test 143 tags: 144 - saas-windows-medium-amd64 145 needs: 146 - job: "build:mingw64" 147 artifacts: true 148 before_script: 149 - *windows_before_script 150 - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz' 151 - New-Item -Path .git/info -ItemType Directory 152 - New-Item .git/info/exclude -ItemType File -Value "/git-sdk" 153 script: 154 - git-sdk/usr/bin/bash.exe -l -c "ci/run-test-slice.sh $CI_NODE_INDEX $CI_NODE_TOTAL" 155 after_script: 156 - git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh' 157 parallel: 10 158 159.msvc-meson: 160 tags: 161 - saas-windows-medium-amd64 162 before_script: 163 - *windows_before_script 164 - choco install -y git meson ninja rust-ms 165 - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 166 - refreshenv 167 168build:msvc-meson: 169 extends: .msvc-meson 170 stage: build 171 script: 172 - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred 173 - meson compile -C build 174 artifacts: 175 paths: 176 - build 177 178test:msvc-meson: 179 extends: .msvc-meson 180 stage: test 181 timeout: 6h 182 needs: 183 - job: "build:msvc-meson" 184 artifacts: true 185 script: 186 - meson test -C build --no-rebuild --print-errorlogs --slice $Env:CI_NODE_INDEX/$Env:CI_NODE_TOTAL 187 parallel: 10 188 artifacts: 189 reports: 190 junit: build/meson-logs/testlog.junit.xml 191 192test:fuzz-smoke-tests: 193 image: ubuntu:latest 194 stage: test 195 needs: [ ] 196 variables: 197 CC: clang 198 before_script: 199 - ./ci/install-dependencies.sh 200 script: 201 - ./ci/run-build-and-minimal-fuzzers.sh 202 203static-analysis: 204 image: ubuntu:22.04 205 stage: analyze 206 needs: [ ] 207 variables: 208 jobname: StaticAnalysis 209 before_script: 210 - ./ci/install-dependencies.sh 211 script: 212 - ./ci/run-static-analysis.sh 213 - ./ci/check-directional-formatting.bash 214 215rust-analysis: 216 image: ubuntu:rolling 217 stage: analyze 218 needs: [ ] 219 variables: 220 jobname: RustAnalysis 221 before_script: 222 - ./ci/install-dependencies.sh 223 script: 224 - ./ci/run-rust-checks.sh 225 226check-whitespace: 227 image: ubuntu:latest 228 stage: analyze 229 needs: [ ] 230 before_script: 231 - ./ci/install-dependencies.sh 232 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged 233 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should 234 # be defined in all pipelines. 235 script: 236 - | 237 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit 238 ./ci/check-whitespace.sh "$R" 239 rules: 240 - if: $CI_PIPELINE_SOURCE == 'merge_request_event' 241 242check-style: 243 image: ubuntu:latest 244 stage: analyze 245 needs: [ ] 246 allow_failure: true 247 variables: 248 CC: clang 249 jobname: ClangFormat 250 before_script: 251 - ./ci/install-dependencies.sh 252 # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged 253 # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should 254 # be defined in all pipelines. 255 script: 256 - | 257 R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit 258 ./ci/run-style-check.sh "$R" 259 rules: 260 - if: $CI_PIPELINE_SOURCE == 'merge_request_event' 261 262documentation: 263 image: ubuntu:latest 264 stage: analyze 265 needs: [ ] 266 variables: 267 jobname: Documentation 268 before_script: 269 - ./ci/install-dependencies.sh 270 script: 271 - ./ci/test-documentation.sh