Fix fourmolu
[cabal.git] / .gitlab-ci.yml
blobb9718af9e77bc18f7bb2407dd94bd531ee6eb171
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-x86_64-linux-alpine:
63   extends: .build
64   tags:
65     - x86_64-linux
66   before_script:
67     # for cabal build
68     - sudo apk add --no-cache zlib zlib-dev zlib-static
69   image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV"
70   variables:
71     TARBALL_ARCHIVE_SUFFIX: x86_64-linux-alpine
72     TARBALL_EXT: tar.xz
73     ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
75 build-x86_64-darwin:
76   extends: .build
77   tags:
78     - x86_64-darwin
79   variables:
80     TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
81     TARBALL_EXT: tar.xz
82     ADD_CABAL_ARGS: ""
84 build-aarch64-darwin:
85   stage: build
86   tags:
87     - aarch64-darwin-m1
88   before_script:
89     - export HOMEBREW_CHANGE_ARCH_TO_ARM=1
90     - arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
91   # C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
92   script: |
93     export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
94     export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
95     export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
96     export LD=ld
97     export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
98     export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
99     export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
100     arch -arm64 /bin/bash ./.gitlab/ci.sh
101   after_script:
102     - rm -Rf /private/tmp/.brew_tmp
103   variables:
104     MACOSX_DEPLOYMENT_TARGET: "10.7"
105     TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
106     TARBALL_EXT: tar.xz
107     ADD_CABAL_ARGS: ""
108     # Update periodically.
109     BREW_VERSION: 4.0.5
110   artifacts:
111     expire_in: 2 week
112     paths:
113       - out/*
114   cache:
115     paths:
116       - .brew
118 build-x86_64-windows:
119   extends: .build
120   script:
121     - $env:CHERE_INVOKING = "yes"
122     - bash '-lc' "ADD_CABAL_ARGS=$env:ADD_CABAL_ARGS GHC_VERSION=$env:GHC_VERSION CABAL_INSTALL_VERSION=$CABAL_INSTALL_VERSION .gitlab/ci.sh"
123   tags:
124     - new-x86_64-windows
125   variables:
126     TARBALL_ARCHIVE_SUFFIX: x86_64-windows
127     TARBALL_EXT: zip
128     ADD_CABAL_ARGS: ""
129   retry: 2