doc: note that AT&T ksh does not work with our test suite
[git/gitster.git] / .gitlab-ci.yml
blob37b991e08079fcbe01c3f5ca7d8eaa28e21e21db
1 default:
2   timeout: 2h
4 workflow:
5   rules:
6     - if: $CI_PIPELINE_SOURCE == "merge_request_event"
7     - if: $CI_COMMIT_TAG
8     - if: $CI_COMMIT_REF_PROTECTED == "true"
10 test:linux:
11   image: $image
12   variables:
13     CUSTOM_PATH: "/custom"
14   before_script:
15     - ./ci/install-dependencies.sh
16   script:
17     - useradd builder --create-home
18     - chown -R builder "${CI_PROJECT_DIR}"
19     - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh
20   after_script:
21     - |
22       if test "$CI_JOB_STATUS" != 'success'
23       then
24         sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
25       fi
26   parallel:
27     matrix:
28       - jobname: linux-sha256
29         image: ubuntu:latest
30         CC: clang
31       - jobname: linux-reftable
32         image: ubuntu:latest
33         CC: clang
34       - jobname: linux-gcc
35         image: ubuntu:20.04
36         CC: gcc
37         CC_PACKAGE: gcc-8
38       - jobname: linux-TEST-vars
39         image: ubuntu:20.04
40         CC: gcc
41         CC_PACKAGE: gcc-8
42       - jobname: linux-gcc-default
43         image: ubuntu:latest
44         CC: gcc
45       - jobname: linux-leaks
46         image: ubuntu:latest
47         CC: gcc
48       - jobname: linux-reftable-leaks
49         image: ubuntu:latest
50         CC: gcc
51       - jobname: linux-asan-ubsan
52         image: ubuntu:latest
53         CC: clang
54       - jobname: pedantic
55         image: fedora:latest
56       - jobname: linux-musl
57         image: alpine:latest
58   artifacts:
59     paths:
60       - t/failed-test-artifacts
61     when: on_failure
63 test:osx:
64   image: $image
65   tags:
66     - saas-macos-medium-m1
67   variables:
68     TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk"
69   before_script:
70     # Create a 4GB RAM disk that we use to store test output on. This small hack
71     # significantly speeds up tests by more than a factor of 2 because the
72     # 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) RAMDisk
75     - ./ci/install-dependencies.sh
76   script:
77     - ./ci/run-build-and-tests.sh
78   after_script:
79     - |
80       if test "$CI_JOB_STATUS" != 'success'
81       then
82         ./ci/print-test-failures.sh
83         mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
84       fi
85   parallel:
86     matrix:
87       - jobname: osx-clang
88         image: macos-13-xcode-14
89         CC: clang
90       - jobname: osx-reftable
91         image: macos-13-xcode-14
92         CC: clang
93   artifacts:
94     paths:
95       - t/failed-test-artifacts
96     when: on_failure
98 test:fuzz-smoke-tests:
99   image: ubuntu:latest
100   variables:
101     CC: clang
102   before_script:
103     - ./ci/install-dependencies.sh
104   script:
105     - ./ci/run-build-and-minimal-fuzzers.sh
107 static-analysis:
108   image: ubuntu:22.04
109   variables:
110     jobname: StaticAnalysis
111   before_script:
112     - ./ci/install-dependencies.sh
113   script:
114     - ./ci/run-static-analysis.sh
115     - ./ci/check-directional-formatting.bash
117 check-whitespace:
118   image: ubuntu:latest
119   before_script:
120     - ./ci/install-dependencies.sh
121   script:
122     - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
123   rules:
124     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
126 documentation:
127   image: ubuntu:latest
128   variables:
129     jobname: Documentation
130   before_script:
131     - ./ci/install-dependencies.sh
132   script:
133     - ./ci/test-documentation.sh