Merge pull request #9543 from mpickering/wip/autogen
[cabal.git] / .gitlab-ci.yml
blob4fdf3ed52045992dcc77606b804136b821a92807
1 stages:
2   - build
4 variables:
5   # Commit of ghc/ci-images repository from which to pull Docker images
6   DOCKER_REV: "572353e0644044fe3a5465bba4342a9a0b0eb60e"
8   GHC_VERSION: 9.2.3
9   CABAL_INSTALL_VERSION: 3.6.2.0
11 workflow:
12   rules:
13     - if: $CI_COMMIT_TAG
14       when: always
15     # Triggered if you start it from the gitlab web ui
16     - if: '$CI_PIPELINE_SOURCE == "web"'
17       when: always
18     - when: never
20 .build:
21   stage: build
22   script:
23     - bash .gitlab/ci.sh
24   artifacts:
25     expire_in: 2 week
26     paths:
27       - out/*
29 build-linux:
30   extends: .build
31   parallel:
32     matrix:
33       - ARCH: i386
34         TAG: x86_64-linux
35         OS:
36           - deb9
37       - ARCH: x86_64
38         TAG: x86_64-linux
39         OS:
40           - centos7
41           - deb9
42           - fedora33
43           - rocky8
44           - ubuntu18_04
45           - ubuntu20_04
46           - deb10
47           - deb11
48       - ARCH: aarch64
49         TAG: aarch64-linux
50         OS:
51           - deb10
52           - deb11
53   tags:
54     - $TAG
55   image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV"
56   variables:
57     PLATFORM: "${ARCH}-linux-${OS}"
58     TARBALL_ARCHIVE_SUFFIX: $PLATFORM
59     TARBALL_EXT: tar.xz
60     ADD_CABAL_ARGS: "--enable-split-sections"
62 build-linux-alpine:
63   extends: .build
64   parallel:
65     matrix:
66       - ARCH: i386
67         OS: [alpine3_12]
68         GHC_VERSION: 9.0.2
69       - ARCH: x86_64
70         OS: [alpine3_12]
71   tags:
72     - x86_64-linux
73   before_script:
74     # for cabal build
75     - sudo apk add --no-cache zlib zlib-dev zlib-static
76   image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV"
77   variables:
78     PLATFORM: "${ARCH}-linux-${OS}"
79     TARBALL_ARCHIVE_SUFFIX: $PLATFORM
80     TARBALL_EXT: tar.xz
81     ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
83 build-x86_64-darwin:
84   extends: .build
85   tags:
86     - x86_64-darwin
87   variables:
88     TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
89     TARBALL_EXT: tar.xz
90     ADD_CABAL_ARGS: ""
92 build-aarch64-darwin:
93   stage: build
94   tags:
95     - aarch64-darwin-m1
96   before_script:
97     - export HOMEBREW_CHANGE_ARCH_TO_ARM=1
98     - arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
99   # C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
100   script: |
101     export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
102     export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
103     export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
104     export LD=ld
105     export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
106     export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
107     export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
108     arch -arm64 /bin/bash ./.gitlab/ci.sh
109   after_script:
110     - rm -Rf /private/tmp/.brew_tmp
111   variables:
112     MACOSX_DEPLOYMENT_TARGET: "10.7"
113     TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
114     TARBALL_EXT: tar.xz
115     ADD_CABAL_ARGS: ""
116     # Update periodically.
117     BREW_VERSION: 4.0.5
118   artifacts:
119     expire_in: 2 week
120     paths:
121       - out/*
122   cache:
123     paths:
124       - .brew
126 build-x86_64-windows:
127   extends: .build
128   script:
129     - $env:CHERE_INVOKING = "yes"
130     - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh"
131   tags:
132     - new-x86_64-windows
133   variables:
134     TARBALL_ARCHIVE_SUFFIX: x86_64-windows
135     TARBALL_EXT: zip
136     ADD_CABAL_ARGS: ""
137   retry: 2