Merge branch 'rs/archive-with-attr-pathspec-fix'
[git/gitster.git] / .gitlab-ci.yml
blob4abfbc3e208e5b9d55b20014eb7b65df45d68109
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   tags:
13     - saas-linux-medium-amd64
14   variables:
15     CUSTOM_PATH: "/custom"
16   before_script:
17     - ./ci/install-dependencies.sh
18   script:
19     - useradd builder --create-home
20     - chown -R builder "${CI_PROJECT_DIR}"
21     - sudo --preserve-env --set-home --user=builder ./ci/run-build-and-tests.sh
22   after_script:
23     - |
24       if test "$CI_JOB_STATUS" != 'success'
25       then
26         sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
27       fi
28   parallel:
29     matrix:
30       - jobname: linux-old
31         image: ubuntu:16.04
32         CC: gcc
33       - jobname: linux-sha256
34         image: ubuntu:latest
35         CC: clang
36       - jobname: linux-reftable
37         image: ubuntu:latest
38         CC: clang
39       - jobname: linux-gcc
40         image: ubuntu:20.04
41         CC: gcc
42         CC_PACKAGE: gcc-8
43       - jobname: linux-TEST-vars
44         image: ubuntu:20.04
45         CC: gcc
46         CC_PACKAGE: gcc-8
47       - jobname: linux-gcc-default
48         image: ubuntu:latest
49         CC: gcc
50       - jobname: linux-leaks
51         image: ubuntu:latest
52         CC: gcc
53       - jobname: linux-reftable-leaks
54         image: ubuntu:latest
55         CC: gcc
56       - jobname: linux-asan-ubsan
57         image: ubuntu:latest
58         CC: clang
59       - jobname: pedantic
60         image: fedora:latest
61       - jobname: linux-musl
62         image: alpine:latest
63   artifacts:
64     paths:
65       - t/failed-test-artifacts
66     when: on_failure
68 test:osx:
69   image: $image
70   tags:
71     - saas-macos-medium-m1
72   variables:
73     TEST_OUTPUT_DIRECTORY: "/Volumes/RAMDisk"
74   before_script:
75     # Create a 4GB RAM disk that we use to store test output on. This small hack
76     # significantly speeds up tests by more than a factor of 2 because the
77     # macOS runners use network-attached storage as disks, which is _really_
78     # slow with the many small writes that our tests do.
79     - sudo diskutil apfs create $(hdiutil attach -nomount ram://8192000) RAMDisk
80     - ./ci/install-dependencies.sh
81   script:
82     - ./ci/run-build-and-tests.sh
83   after_script:
84     - |
85       if test "$CI_JOB_STATUS" != 'success'
86       then
87         ./ci/print-test-failures.sh
88         mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
89       fi
90   parallel:
91     matrix:
92       - jobname: osx-clang
93         image: macos-13-xcode-14
94         CC: clang
95       - jobname: osx-reftable
96         image: macos-13-xcode-14
97         CC: clang
98   artifacts:
99     paths:
100       - t/failed-test-artifacts
101     when: on_failure
103 test:fuzz-smoke-tests:
104   image: ubuntu:latest
105   variables:
106     CC: clang
107   before_script:
108     - ./ci/install-dependencies.sh
109   script:
110     - ./ci/run-build-and-minimal-fuzzers.sh
112 static-analysis:
113   image: ubuntu:22.04
114   variables:
115     jobname: StaticAnalysis
116   before_script:
117     - ./ci/install-dependencies.sh
118   script:
119     - ./ci/run-static-analysis.sh
120     - ./ci/check-directional-formatting.bash
122 check-whitespace:
123   image: ubuntu:latest
124   before_script:
125     - ./ci/install-dependencies.sh
126   # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
127   # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
128   # be defined in all pipelines.
129   script:
130     - |
131       R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
132       ./ci/check-whitespace.sh "$R"
133   rules:
134     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
136 check-style:
137   image: ubuntu:latest
138   allow_failure: true
139   variables:
140     CC: clang
141     jobname: ClangFormat
142   before_script:
143     - ./ci/install-dependencies.sh
144   # Since $CI_MERGE_REQUEST_TARGET_BRANCH_SHA is only defined for merged
145   # pipelines, we fallback to $CI_MERGE_REQUEST_DIFF_BASE_SHA, which should
146   # be defined in all pipelines.
147   script:
148     - |
149       R=${CI_MERGE_REQUEST_TARGET_BRANCH_SHA-${CI_MERGE_REQUEST_DIFF_BASE_SHA:?}} || exit
150       ./ci/run-style-check.sh "$R"
151   rules:
152     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
154 documentation:
155   image: ubuntu:latest
156   variables:
157     jobname: Documentation
158   before_script:
159     - ./ci/install-dependencies.sh
160   script:
161     - ./ci/test-documentation.sh