Patrick Steinhardt | 0e3b67e | 2023-11-09 09:05:54 +0100 | [diff] [blame] | 1 | default: |
| 2 | timeout: 2h |
| 3 | |
| 4 | workflow: |
| 5 | rules: |
| 6 | - if: $CI_PIPELINE_SOURCE == "merge_request_event" |
| 7 | - if: $CI_COMMIT_TAG |
| 8 | - if: $CI_COMMIT_REF_PROTECTED == "true" |
| 9 | |
Patrick Steinhardt | 56090a3 | 2024-01-18 11:23:02 +0100 | [diff] [blame] | 10 | test:linux: |
Patrick Steinhardt | 0e3b67e | 2023-11-09 09:05:54 +0100 | [diff] [blame] | 11 | image: $image |
| 12 | before_script: |
| 13 | - ./ci/install-docker-dependencies.sh |
| 14 | script: |
| 15 | - useradd builder --create-home |
| 16 | - chown -R builder "${CI_PROJECT_DIR}" |
| 17 | - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh |
| 18 | after_script: |
| 19 | - | |
| 20 | if test "$CI_JOB_STATUS" != 'success' |
| 21 | then |
| 22 | sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh |
| 23 | fi |
| 24 | parallel: |
| 25 | matrix: |
| 26 | - jobname: linux-sha256 |
| 27 | image: ubuntu:latest |
| 28 | CC: clang |
Patrick Steinhardt | c0350cb | 2024-02-07 08:20:35 +0100 | [diff] [blame] | 29 | - jobname: linux-reftable |
| 30 | image: ubuntu:latest |
| 31 | CC: clang |
Patrick Steinhardt | 0e3b67e | 2023-11-09 09:05:54 +0100 | [diff] [blame] | 32 | - jobname: linux-gcc |
| 33 | image: ubuntu:20.04 |
| 34 | CC: gcc |
| 35 | CC_PACKAGE: gcc-8 |
| 36 | - jobname: linux-TEST-vars |
| 37 | image: ubuntu:20.04 |
| 38 | CC: gcc |
| 39 | CC_PACKAGE: gcc-8 |
| 40 | - jobname: linux-gcc-default |
| 41 | image: ubuntu:latest |
| 42 | CC: gcc |
| 43 | - jobname: linux-leaks |
| 44 | image: ubuntu:latest |
| 45 | CC: gcc |
Patrick Steinhardt | c0350cb | 2024-02-07 08:20:35 +0100 | [diff] [blame] | 46 | - jobname: linux-reftable-leaks |
| 47 | image: ubuntu:latest |
| 48 | CC: gcc |
Patrick Steinhardt | 0e3b67e | 2023-11-09 09:05:54 +0100 | [diff] [blame] | 49 | - jobname: linux-asan-ubsan |
| 50 | image: ubuntu:latest |
| 51 | CC: clang |
| 52 | - jobname: pedantic |
| 53 | image: fedora:latest |
| 54 | - jobname: linux-musl |
| 55 | image: alpine:latest |
| 56 | artifacts: |
| 57 | paths: |
| 58 | - t/failed-test-artifacts |
| 59 | when: on_failure |
Patrick Steinhardt | cd69c63 | 2023-12-28 12:02:50 +0100 | [diff] [blame] | 60 | |
Patrick Steinhardt | 56090a3 | 2024-01-18 11:23:02 +0100 | [diff] [blame] | 61 | test:osx: |
| 62 | image: $image |
| 63 | tags: |
| 64 | - saas-macos-medium-m1 |
| 65 | variables: |
| 66 | TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk" |
| 67 | before_script: |
| 68 | # Create a 4GB RAM disk that we use to store test output on. This small hack |
| 69 | # significantly speeds up tests by more than a factor of 2 because the |
| 70 | # macOS runners use network-attached storage as disks, which is _really_ |
| 71 | # slow with the many small writes that our tests do. |
| 72 | - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk |
| 73 | - ./ci/install-dependencies.sh |
| 74 | script: |
| 75 | - ./ci/run-build-and-tests.sh |
| 76 | after_script: |
| 77 | - | |
| 78 | if test "$CI_JOB_STATUS" != 'success' |
| 79 | then |
| 80 | ./ci/print-test-failures.sh |
| 81 | mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/ |
| 82 | fi |
| 83 | parallel: |
| 84 | matrix: |
| 85 | - jobname: osx-clang |
| 86 | image: macos-13-xcode-14 |
| 87 | CC: clang |
Patrick Steinhardt | c0350cb | 2024-02-07 08:20:35 +0100 | [diff] [blame] | 88 | - jobname: osx-reftable |
| 89 | image: macos-13-xcode-14 |
| 90 | CC: clang |
Patrick Steinhardt | 56090a3 | 2024-01-18 11:23:02 +0100 | [diff] [blame] | 91 | artifacts: |
| 92 | paths: |
| 93 | - t/failed-test-artifacts |
| 94 | when: on_failure |
| 95 | |
Patrick Steinhardt | cd69c63 | 2023-12-28 12:02:50 +0100 | [diff] [blame] | 96 | static-analysis: |
| 97 | image: ubuntu:22.04 |
| 98 | variables: |
| 99 | jobname: StaticAnalysis |
| 100 | before_script: |
| 101 | - ./ci/install-docker-dependencies.sh |
| 102 | script: |
| 103 | - ./ci/run-static-analysis.sh |
| 104 | - ./ci/check-directional-formatting.bash |