Merge pull request #8602 from andreabedini/patch-1
[cabal.git] / .gitlab-ci.yml
blob751ee16f0195c1b579746a165b7eac99bbadb901
1 stages:
2   - build
4 # Used for ci setup in the gitlab mirror of the project:
5 # https://gitlab.haskell.org/haskell/haskell-language-server/-/pipelines
6 variables:
7   # Commit of ghc/ci-images repository from which to pull Docker images
8   DOCKER_REV: "9e4c540d9e4972a36291dfdf81f079f37d748890"
10   GHC_VERSION: 9.2.3
11   CABAL_INSTALL_VERSION: 3.6.2.0
13 workflow:
14   rules:
15     - if: $CI_COMMIT_TAG
16       when: always
17     # Triggered if you start it from the gitlab web ui
18     - if: '$CI_PIPELINE_SOURCE == "web"'
19       when: always
20     - when: never
22 .build:
23   stage: build
24   script:
25     - bash .gitlab/ci.sh
26   artifacts:
27     expire_in: 2 week
28     paths:
29       - out/*
31 build-aarch64-linux-deb10:
32   extends: .build
33   tags:
34     - aarch64-linux
35   image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV"
36   variables:
37     TARBALL_ARCHIVE_SUFFIX: aarch64-linux-deb10
38     TARBALL_EXT: tar.xz
39     ADD_CABAL_ARGS: ""
41 build-armv7-linux-deb10:
42   extends: .build
43   tags:
44     - armv7-linux
45   image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV"
46   variables:
47     TARBALL_ARCHIVE_SUFFIX: armv7-linux-deb1
48     TARBALL_EXT: tar.xz
49     ADD_CABAL_ARGS: ""
50     # temp, because 3.6.2.0 is broken
51     CABAL_INSTALL_VERSION: 3.4.0.0
52   retry: 2
54 build-x86_64-linux:
55   extends: .build
56   tags:
57     - x86_64-linux
58   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV"
59   variables:
60     TARBALL_ARCHIVE_SUFFIX: x86_64-linux-deb10
61     TARBALL_EXT: tar.xz
62     ADD_CABAL_ARGS: "--enable-split-sections"
64 build-x86_64-linux-deb11:
65   extends: .build
66   tags:
67     - x86_64-linux
68   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV"
69   variables:
70     TARBALL_ARCHIVE_SUFFIX: x86_64-linux-deb11
71     TARBALL_EXT: tar.xz
72     ADD_CABAL_ARGS: "--enable-split-sections"
74 build-x86_64-linux-alpine:
75   extends: .build
76   tags:
77     - x86_64-linux
78   before_script:
79     # for cabal build
80     - sudo apk add --no-cache zlib zlib-dev zlib-static
81   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV"
82   variables:
83     TARBALL_ARCHIVE_SUFFIX: x86_64-linux-alpine
84     TARBALL_EXT: tar.xz
85     ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
87 build-i386-linux-alpine:
88   extends: .build
89   tags:
90     - x86_64-linux
91   image: "i386/alpine:3.12"
92   before_script:
93     # for GHC
94     - apk add --no-cache bash curl gcc g++ binutils binutils-gold bsd-compat-headers gmp-dev ncurses-dev libffi-dev make xz tar perl
95     # for cabal build
96     - apk add --no-cache zlib zlib-dev zlib-static
97   variables:
98     TARBALL_ARCHIVE_SUFFIX: i386-linux-alpine
99     TARBALL_EXT: tar.xz
100     ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
101     # temp, because 3.6.2.0 is broken
102     CABAL_INSTALL_VERSION: 3.4.0.0
104 build-x86_64-freebsd12:
105   extends: .build
106   tags:
107     - x86_64-freebsd12
108   variables:
109     TARBALL_ARCHIVE_SUFFIX: x86_64-freebsd12
110     TARBALL_EXT: tar.xz
111     ADD_CABAL_ARGS: "--enable-split-sections"
113 build-x86_64-darwin:
114   extends: .build
115   tags:
116     - x86_64-darwin
117   variables:
118     TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
119     TARBALL_EXT: tar.xz
120     ADD_CABAL_ARGS: ""
122 build-aarch64-darwin:
123   stage: build
124   tags:
125     - aarch64-darwin-m1
126   before_script:
127     - export HOMEBREW_CHANGE_ARCH_TO_ARM=1
128     - arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
129   # C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
130   script: |
131     export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
132     export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
133     export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
134     export LD=ld
135     export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
136     export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
137     export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
138     arch -arm64 /bin/bash ./.gitlab/ci.sh
139   after_script:
140     - rm -Rf /private/tmp/.brew_tmp
141   variables:
142     MACOSX_DEPLOYMENT_TARGET: "10.7"
143     TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
144     TARBALL_EXT: tar.xz
145     ADD_CABAL_ARGS: ""
146   artifacts:
147     expire_in: 2 week
148     paths:
149       - out/*
151 build-x86_64-windows:
152   extends: .build
153   script:
154     - $env:CHERE_INVOKING = "yes"
155     - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh"
156   tags:
157     - new-x86_64-windows
158   variables:
159     TARBALL_ARCHIVE_SUFFIX: x86_64-windows
160     TARBALL_EXT: zip
161     ADD_CABAL_ARGS: ""
162   retry: 2